script to modify the text of a text object | Community
Skip to main content
MHWinter
Level 4
June 27, 2025
Solved

script to modify the text of a text object

  • June 27, 2025
  • 1 reply
  • 701 views

Hello,

I am developing a form (XFA dynamic PDF) that can be translated by selecting the language.

When the language is selected, the form updates the caption of all fields with corresponding text in the selected language.

For that, I use the following script: oTarget.caption.value.resolveNode("#text").value = CaptionTranslation[i][Language];

CaptionTranslation is a 2-dimentional array listing all the objects that need to be translated, and for each object, the translation in every supported language.

This works for various types of objects, but not for text objects that do not have a caption property.

What should be the script to change the text of a text object?

 

Thank you in advance

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MHWinter

Got it:  oTarget.value.resolveNode("#text").value = CaptionTranslation[i][Language];

1 reply

MHWinter
MHWinterAuthorAccepted solution
Level 4
June 27, 2025

Got it:  oTarget.value.resolveNode("#text").value = CaptionTranslation[i][Language];