Skip to main content
MHWinter
Level 4
Jun 27, 2025 4:06 PM UTC
Solved

script to modify the text of a text object

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.
MHWinter
MHWinterAccepted solution
Level 4
Jun 27, 2025 5:30 PM UTC

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

1 reply

MHWinter
MHWinterAuthorAccepted solution
Level 4
Jun 27, 2025 5:30 PM UTC

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

Translate