5 Replies Latest reply on Apr 12, 2014 1:30 AM by George_Johnson

    Why aren't my conditional checkboxes working anymore?

    MelanieM

      Hi

       

      I have a question:

       

      I have to make a form with 4 checkboxes. If checkbox 1 is activated only certain fields are supposed to stay visible. The same goes for the other 3 checkboxes.

       

      I wrote a little java script for each checkbox (I think I found it in one of the answers here in the forum):

       

      var nHide = event.target.isBoxChecked(0)?display.visible:display.hidden; 
      this.getField("B.").display = nHide;
      this.getField("S.").display = nHide;
      this.getField("A.").display = nHide;
      this.getField("BS.").display = nHide;
      this.getField("SA.").display = nHide;
      this.getField("BSA.").display = nHide;
      

       

       

      There are a lot of text fields in this form. And every field belongs to a "group": M, B, S, A, BS, SA or MSA (e.g. M.Grading1, S.Question etc), and every group "belongs" to one of the four checkboxes

      • Checkbox 1 should only show the groups M and MSA
      • Checkbox 2 should only show the groups B, BS
      • Checkbox 3 should only show the groups S, BS, SA, MSA
      • Checkbox 4 should only show the groups A, MSA

       

      And at first that script worked perfectly.

       

      But then we changed a few things about the form (well, the original word document) and I copy-pasted all the fields into the new adobe form.

      The only thing that is different is that 4 or 5 text fields are now in a different group. I changed the groupname of the textfields (e.g. BS.Grading1, MSA.Question etc) but it still doesn't work. I redid the whole javascript, but the changed text fields just don't react. The old ones still work though.

       

      Please help, I just got started with javascript at work. I really don't understand why this doesn't work anymore when it did before...

       

      Thanks so much!

      Melanie