4 Replies Latest reply: Feb 4, 2014 2:47 PM by BSisson RSS

    Forms fields changing them-selves?

    BSisson Community Member

      Ok... I have been working on a big complex form....

       

      Lots of fields of Mostly Checkboxes and Text

       

      In several cases, I open the Checkbox Field, edit "Export Data" to be "Off" (no quotes) and then close the filed

       

      Run my script, which runs fine.

       

      CHECK THE BOX, run the script, and the Export Data (.value) HAS CHANGED to "YES" or " " (blank).

       

      I have edited the same field several times.  Deleted it and started from scratch.  Closed Acrobat and re-opened.

       

      I even tried modifying my code and use "N/A" rather than "Off" thinking "Off" might be a reserved word....same issue....some fields just are self-editing....

       

      What is going on ??

       

      This is in Acrobat-Pro-XI    (11.0.6)

        • 1. Re: Forms fields changing them-selves?
          GKaiseril CommunityMVP

          The value for a check box or radio button group that has no selection is "Off" so that value should not be be entered through the options window.

          • 2. Re: Forms fields changing them-selves?
            BSisson Community Member

            Uhm... that might account for some strangeness, but it seems random

             

            I have two cases I need to account for

             

            1- Value doesn't matter

             

                   Had been using (Off) as the Export Value (.value) field entry. These are the field that are being flakey.

             

            2 - Value DOES matter

             

                  Has a text Field "This is the text for button #x"

             

                 Where ".value" has text typed in it is stable.

             

            I need something that I can put into the Export Value (.value) field that I can realiably count on so that if the Checkbox -IS- selected -AND-  the field is that particular value I can skip it.   Can I use "N/A"  or "null (the word null)"

            • 3. Re: Forms fields changing them-selves?
              George_Johnson CommunityMVP

              You can use whatever you want for the export value of a check box, but you should not use "Off". In code, you can determine whether a check box is selected by comparing its value to "Off". If it is "Off" then the check box is not selected.

               

              A field value cannot be equal to the special value of null. Comparing a check box field value to the string "N/A" would only make sense if that's what you set the export value to.

              • 4. Re: Forms fields changing them-selves?
                BSisson Community Member

                Yup...found that out the hard way.

                 

                Ended up having to use a DOUBLE test because I have lots of checkboxes that aren't used for anything but "show"

                 

                Had to use  Button.isBoxChecked && Button.value != "NA"

                 

                and THEN I had to worry about javascript precident in that if the first value is TRUE it doesn't evaluate the second.... so I had to re-order some of my tests...

                 

                Once I got rid of the "Off" which behaves like a reserved word -AND- got my logic clean, things started behaving.