Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Text object changed, but text not refreshing

shyamguth
Level 1
Level 1

I have searched and searched for the problem, but am having no luck.

I have a simple Text object. Dynamically as buttons are clicked, I want to set the text value of this Text object. I tried:

textObject.rawValue = "my text";

The actual text on the PDF file does not update. It is a dynamic PDF, as other scripts on the same page work. I used this same code to successfully set the text of a TextField object, so I am stumped.

Any help would be great. Thank you.

1 Accepted Solution
Paul_Butenko
Correct answer by
Level 6
Level 6

Hi,

I've made example form for you. It is dynamic form for Reader 9. I added radiobuttons and butto, both of them have onClick event which will change TextObject.

BR,

Paul Butenko

View solution in original post

5 Replies
Yan_Kliaver
Level 4
Level 4

Are you sure that the name of the texfield is textObject?

By default it is a TextField1, 2 and so on.

Check if you are in javascript mode and try this:

[nameofyourfield].rawValue = "my text";


If it not working you can post a your pdf I'll take a look.

Yan.

Paul_Butenko
Level 6
Level 6

Hi,

Text object doesn't have rawValue. If you want to change value of Text object try this scrript:

xfa.resolveNode("Text1.caption.value.#text").value ="some text"

BR,

Paul Butenko

shyamguth
Level 1
Level 1

I'm in JavaScript, and I am using the correct text object name. I have tried the above suggestion, and many others to no avail.

Attached is an example PDF. When the radio button is clicked, the text should change in the Text1 object. Please look at the click event of the radio button. A bunch of other attempts at changing the text are commented out.

Thanks for taking the time to look.

Paul_Butenko
Correct answer by
Level 6
Level 6

Hi,

I've made example form for you. It is dynamic form for Reader 9. I added radiobuttons and butto, both of them have onClick event which will change TextObject.

BR,

Paul Butenko

View solution in original post

shyamguth
Level 1
Level 1

Thanks so much for your time and help!