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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

change caption numeric field

Avatar

Level 2

I have a form with at least 2 radio buttons named type1 and type2  and on 2 different pages 2 numeric fields NF[0] and NF[1], the binding of NF is global.

if I select the radiobutton type1 then the caption of NF[0] and NF[1] should change into "Type1" and visa versa

I have the following javascript text in the change of the radiobuttonlist:

if (this.rawValue == 1)

{

xfa.form.form1.test.NF.caption.value.text.value = "type1";

}

else if (this.rawValue == 2)

{

xfa.form.form1.test.NF.caption.value.text.value = "type2";

}

this only changes the caption of NF[0], how do I change the caption of NF[1]??

best wishes

Simone

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can change it with the names that you have but the syntax of the expression is quite confusing:

xfa.resolveNode("xfa.form.form1.test.NF[1]").caption.value.text.value = "type2"

If you rename the field to a unique name then you can set it like the first one:

xfa.form.form1.test.NFnewName.caption.value.text.value = "test2"

Note that you do not need the xfa.form at the beginning of the expression ....so to simplify it woudl be:

form1.test.NFnewName.caption.value.text.value = "test2"

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

You can change it with the names that you have but the syntax of the expression is quite confusing:

xfa.resolveNode("xfa.form.form1.test.NF[1]").caption.value.text.value = "type2"

If you rename the field to a unique name then you can set it like the first one:

xfa.form.form1.test.NFnewName.caption.value.text.value = "test2"

Note that you do not need the xfa.form at the beginning of the expression ....so to simplify it woudl be:

form1.test.NFnewName.caption.value.text.value = "test2"

Paul

Avatar

Level 2

you noted that I didn't need to use xfa.form as prefix but I have had several files that if I didn't use the prefix the form wouldn't work, so the prevent that from happening I use it everywhere