Expand my Community achievements bar.

How to change the caption of a field with a button?

Avatar

Level 1

I have serious trouble, don't know why, in order to change the caption of a field.

I can't do it with a button as in any other way...dropdown list, ecc...

Assumes that we have a button and "on click" i want to change the caption of a numeric or text field.

form1.ppp.Button1::click - (FormCalc, client)
NumericField1.caption.value.text.value = "whatever you want to set it to";
TextField1.caption.value.text.value = "whatever you want to set it to";
xfa.form.form1.ppp.NumericField1.rawValue = xfa.form.form1.ppp.NumericField1.rawValue + 1;

The numerical value inside the numericalfield1 is increased each click...but the caption still the same.

Why this happen?

I check many threads on this forum and on google and i still find these samples...

please help.

Thank you

4 Replies

Avatar

Level 1

Yes, it is. Also in preview i checked "dynamic XML". is it right?

i try to download this sample while searching in the forum to solve my problem

https://acrobat.com/#d=pxtis4z3OxCqWxajZwDS2Q

i try to add to that form my code and it's work!! i can't undersand why...

Below you can find my PDF...i can't understand why here the same code doesn't work

http://www.hsc350.it/download/Untitled2.pdf

Thank you again!

Avatar

Level 1

Thank you PAul.

i soloved my problem. The point was that my form was saved static by default and doesn't care that i put preview mode in dynamic mode...it doesn't work.

my question is: Why this happen? i guess that is a form preview is setted as dynamic it should work as dynamic (the preview i mean...regardless to the type of saving i used.)

thanks again.

Avatar

Former Community Member

Once you save a form there is a processing instruction in the template that indicates how you want the form to render. This will override the settings in the Preview.

Paul