Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to disable (greyout) or enable bunch of radio buttons based on checking of other radio button

Engaged ,
Jul 22, 2016 Jul 22, 2016

How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?

I’m creating a form where the user has option to choose type of medical examinations as below :

I want a javascript which allow me to grey out / disable the sub-radio buttons.  in above example user can choose any number of medical examination.. but the sub-section should be activated when they choose the heading check box.... .

For ex... when they choose "Periodontal Examination and Treatment" then only their sub-radio button should activated else it should be greyed out / disable and reset.   and when  Graft procedure is checked then only the Text field associated to them should be activated else it should be disabled / greyed out. ....

i tried the following code but it doesnot work

/ Function to enable form fields function

EnableFormField (cFieldName) {

// First acquire the field to be enabled

var oFld = this.getField(cFieldName)

// Next acquire the hidden field with the normal colors

var oNmlFld = this.getField("NormalColorsFld");

if(oFld) {

// Make field interactive

oFld.readonly = false;

// Restore Normal Colors

oFld.fillColor = oNmlFld.fillColor;

oFld.borderColor = oNmlFld.borderColor;

oFld.textColor = oNmlFld.textColor;

}

}

// Function to disable form fields function

DisableFormField(cFieldName) {

// First acquire the field to be disabled

var oFld = this.getField(cFieldName)

if(oFld) {

// Make field Read-Only

oFld.readonly = true;

// Set Grayed out colors

oFld.fillColor = ["G", 0.75]; oFld.borderColor = ["G", 2/3]; oFld.textColor = ["G", 0.5];

}

}

TOPICS
Acrobat SDK and JavaScript , Windows
661
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation