6 Replies Latest reply on Sep 19, 2014 5:18 AM by ISPAmy

    Use javascript to have a checkbox determine radio button value

    ISPAmy

      I am creating a form that is sectioned off into numerous topics. Not all topics will be pertinent for all users.

       

      Under each topic is several statements, each followed by a 3-choice radio button group. The choices are "Yes", "No", and "Not Applicable".

       

      I have created a "Not Applicable" checkbox at the top of each section. What I would like to accomplish is for all radio buttons for that subtopic to default to "Not Applicable" if the checkbox for the topic is checked.

       

      I tried putting this in the Mouse Up event for the checkbox to no avail (in frustration, I tried it in the Mouse Down and Mouse Exit events as well to no success):

       

      //Auto Check Related Not Applicable Radio Buttons

       

      var cb = this.getField("cbSaNa");

       

      if (cb.isBoxChecked(0))

       

      {

       

        rbSa1.value = "NA"

       

        rbSa2.value = "NA"

       

        rbSa3.value = "NA"

       

        rbSa4.value = "NA"

       

        rbSa5.value = "NA"

       

        rbSa6.value = "NA"

       

      }

       

      Yes, the "Not Applicable" choice's value is "NA".

       

      I much appreciate any help.