2 Replies Latest reply on Sep 23, 2010 7:27 AM by swvermeulen

    change caption numeric field

    swvermeulen Level 1

      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


        • 1. Re: change caption numeric field
          pguerett Level 6

          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"



          • 2. Re: change caption numeric field
            swvermeulen Level 1

            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