These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

change caption numeric fields

swvermeulen
Registered: Sep 23 2010
Posts: 3
Answered

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

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
In FormCalc it's possible to include the instance number in the object path. But in JavaScript the SOM path is used indirectly though the resolveNode function.

xfa.form.form1.test.resolveNode("NF[0]").caption.value.text.value = "Type1";

Have you seen this e-seminar on scripting in LiveCycle?
http://adobechats.adobe.acrobat.com/p87746471/


Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script