3 Replies Latest reply: Feb 22, 2012 2:34 PM by GKaiseril RSS

    Syntax for hiding a radio button in a radio group

    Milton123321 Community Member

      Good afternoon,

       

      Syntax question.

       

      I have a radio box group named "CheckMainbox" with 4 choices named "choice 1" "choice 2" "choice 3" and "choice4".

       

      My proposed code

       

      if(event.value=="true"){

           this.getField("CheckMainbox").value="choice1".display.hidden <----- This is the wrong code but what is the proper syntax to do this?

           }

        • 1. Re: Syntax for hiding a radio button in a radio group
          GKaiseril CommunityMVP

          You might try accessing the child or widget item. See the Acrobat JS API Reference for more information about the "widget" for check boxes and radio buttons.

          • 2. Re: Syntax for hiding a radio button in a radio group
            Milton123321 Community Member

            Hmm,

             

            Cant seem to find anything.

             

            There isnt a simple line of code I can input?

             

            For fields it is easy:

             

            this.getField("Name").display=display.hidden

             

            There has to be a way to do it via Javascript if I can change individual radio buttons in a group from visible to hidden.

            • 3. Re: Syntax for hiding a radio button in a radio group
              GKaiseril CommunityMVP

              I found this:

               

              Field versus widget attributes

              Some properties of the Field object, such as value, apply to all widgets that are children of that field. Other properties, such as rect, are specific to individual widgets.

               

              The following field properties and methods affect field-level attributes:
              calcOrderIndex, charLimit, comb, currentValueIndices,defaultValue, doNotScroll, doNotSpellCheck, delay, doc, editable, exportValues, fileSelect, multiline, multipleSelection, name, numItems,page, password,
              readonly, required,submitName, type, userName, value, valueAsString, clearItems, browseForFileToSubmit, deleteItemAt, getItemAt, insertItemAt, setAction, setItems,signatureInfo, signatureSign, and signatureValidate.

               

              The following field properties and methods affect widget-level attributes:
              alignment, borderStyle, buttonAlignX, buttonAlignY, buttonPosition, buttonScaleHow, buttonScaleWhen, display, fillColor, hidden, highlight, lineWidth, print, rect, strokeColor, style, textColor, textFont, textSize, buttonGetCaption, buttonGetIcon, buttonImportIcon, buttonSetCaption, buttonSetIcon, checkThisBox, defaultIsChecked, isBoxChecked, isDefaultChecked, setAction, and setFocus.

               

              So I would think the following would work for a widget:

               

              // get widget 0 for Radio Button1;

              var f = this.getField("Radio Button1.0");

              f.hidden = true; // hide widget;