2 Replies Latest reply on Dec 17, 2008 12:14 PM by (Lamin_Jobarteh)

    how to hide a radio button


      I am new to Adobe JavaScript, so please bear with me.

      I have a PDF document with one Check Box, under which I have a Radio Button. I am able to display/hide the Radio Button by checking the Check Box with JavaScript shown below:

      var hideCheckBox = event.target.isBoxChecked(0)?display.visible:display.hidden

      this.getField("RadioButton1").display = hideCheckBox;

      What I am trying to accomplish now is to hide the Radio Button when I first open the PDF document until I check the Check Box.

      Will really appreciate any help. Thanks
        • 1. Re: how to hide a radio button
          gkaiseril MVP & Adobe Community Professional
          You can set the initial status for the radio button as hidden.

          And use the following JavaScript for the "Mouse Up" action:

          if (this.getField("Radio Button").display == display.hidden) {
          this.getField("Radio Button").display = display.visible;
          } else {
          this.getField("Radio Button").display = display.hidden;

          The code just toggles the radio button display.

          If you want to set the initial state, use the following document level JavaScript:

          this.getField("CheckBox").value = "Off"; // uncheck check box field
          this.getField("Radio Button").display = display.hidden; // hide radio button

          You may need to change the "CheckBox" to the field name of the check box.
          • 2. Re: how to hide a radio button
            Level 1
            It worked perfectly. Thanks a whole lot.