Expand my Community achievements bar.

SOLVED

Text object changed, but text not refreshing

Avatar

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

Avatar

Correct answer by
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

Avatar

Former Community Member

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.

Avatar

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

Avatar

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.

Avatar

Correct answer by
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

Avatar

Level 1

Thanks so much for your time and help!