4 Replies Latest reply on Jan 27, 2014 12:14 PM by gkaiseril

    Using a field hierarchy for selecting checkboxes?

    Lane Goolsby

      I have a bunch of checkboxes in a PDF that are dynamically added to the PDF during its creation process. Each checkbox is a cell in a table, and I do not know the number of rows or columns that will be in the PDF beforehand. What we are trying to do is add a header row to the table that allows the users to select/unselect all the check boxes in a column at once. I figured I could use the field name hierarchy approach to select/unselect all the checkboxes as long as I named them appropriately but I appear to be missing something.


      Take for example this table (assume [] denotes where a checkbox will go):


      TitleCategory 1Category 2

      Some Product[check.category1.cell1][check.category2.cell1]
      Another Product[check.category1.cell2][check.category2.cell2]


      What I would like to do is add a JavaScript call so that when check.global.category1 is clicked I could add something like this to the click event:


      var field = getField("check.category1");
      field.checkThisBox() //or checkThisBox(false);


      And that would toggle all the check boxes in the Category 1 column. However, that does not appear to work. Is there another mechanism to do this, or some way I can loop over all the check boxes that belong to the same hierarchy? I know this approach works with buttons and text fields but checkboxes appear to be different.