Copy link to clipboard
Copied
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];
}
}
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now