Skip navigation
Currently Being Moderated

Syntax for hiding a radio button in a radio group

Feb 22, 2012 8:55 AM

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?

     }

 
Replies
  • Currently Being Moderated
    Feb 22, 2012 11:42 AM   in reply to Milton123321

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 22, 2012 2:34 PM   in reply to Milton123321

    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;

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points