2 Replies Latest reply on May 25, 2016 11:01 AM by MarkWalsh

    Setting value of Checkbox Field Group

    MarkWalsh Level 4

      It's been a while since I've had to do any Javascript in a PDF, and I'm feeling a little bit too rusty.  I need to set a value of a group of checkbox fields.


      The fields are named 'Base.Category.Subcategory.xxxxx'. The following doesn't work the way I need it:


      var oFld = this.getField('Base.Category')

      oFld.value = 'Off'


      I can set the visibility for all of the checkboxes in a specific category or subcategory, but how do I set the value for all of the checkboxes? I'd rather not hard-code this for each combination.

        • 1. Re: Setting value of Checkbox Field Group
          gkaiseril MVP & Adobe Community Professional

          One cannot set the value of a hierarchical field group using the value property. One can only set the common properties at the parent level, the value is not considered a common property.


          If the default value for all the check boxes is "Off" one can reset the group using the parent field name.


          If that is not the case, convert the parent group to an array of field objects using the "getArray()" method and then walk the array or make an array or names and set each field's value.

          • 2. Re: Setting value of Checkbox Field Group
            MarkWalsh Level 4

            Thanks, I thought that was the case. I had also tried using 'checkThisBox' hoping that might work with a group, but had the same results.


            'getArray' is exactly what I was looking for. Everything is working now as I expected.



            Appreciate the assistance!