4 Replies Latest reply on Sep 9, 2013 6:30 AM by rlegs09

    Multiple Check Boxes but only select one

    rlegs09

      I need to create a PDF form that uses three check boxes to show / hide three separate text fields. Each check box needs to toggle the field on and then off and only one check box can be checked at a time. I am stumped and need help. thanks.

        • 1. Re: Multiple Check Boxes but only select one
          try67 MVP & Adobe Community Professional

          To create a check-box group that works like a radio-button group you need to give them the same name, but different export values.

           

          To implement the show/hide fields functionality you'll need to use a script (attached to the MouseUP action of each check-box), which should look something like this:

           

          if (event.target.value=="Value1") {

               this.getField("Field1").display = display.visible;

               this.getField("Field2").display = display.hidden;

               this.getField("Field3").display = display.hidden;

          } else if (event.target.value=="Value2") {

               this.getField("Field1").display = display.hidden;

               this.getField("Field2").display = display.visible;

               this.getField("Field3").display = display.hidden;

          }

           

          etc.

          • 2. Re: Multiple Check Boxes but only select one
            rlegs09 Level 1

            Thanks that works a treat. One issue though is once a selection has been made and then the box is unclicked, the last text field remains visible. I have set it to hidden.

            • 3. Re: Multiple Check Boxes but only select one
              try67 MVP & Adobe Community Professional

              At the end of your code add something like this:

               

              } else  {

                   this.getField("Field1").display = display.hidden;

                   this.getField("Field2").display = display.hidden;

                   this.getField("Field3").display = display.hidden;

              }

              • 4. Re: Multiple Check Boxes but only select one
                rlegs09 Level 1

                Top stuff!!

                Solved all of my problems. Thanks so much