Copy link to clipboard
Copied
I haven Acro Form. There is a button in that form to show/hide other fields.
Normally, I assign a mouse up event and run a javascript as shown in the following example:
var oChkFld = this.getField("0_HiddenCheck_HideShow");
oChkFld.checkThisBox(0,!oChkFld.isBoxChecked(0));
this.getField("0_question_title").display = (oChkFld.value=="Off") ? display.hidden : display.visible;
And it works perfect.
But when it comes to the radio buttons, it does not function.
I indicate the group name of the corresponding radio buttons.
Example:
There is a group name of radio buttons called: "Collection_Extendibility" and inside there are options of "changing", "closed", etc.
So I write:
var oChkFld = this.getField("0_HiddenCheck_HideShow");
oChkFld.checkThisBox(0,!oChkFld.isBoxChecked(0));
this.getField("Collection_Extendibility").display = (oChkFld.value=="Off") ? display.hidden : display.visible;
But it does nothing.
Copy link to clipboard
Copied
Radio buttons and check boxes are very much alike. When nothing is checked/selected, the output value is "Off", but if something is checked then the output value is the "Export Value" for the checked button/checkbox.
The technique you are using for checkboxes avoids dealing with the export value by always looking for the "Unchecked" value. But you can't do that with radio buttons because you've got more than one in the group.
Another issue, and the only real difference between checkboxes and radio buttons, is that checkboxes turn both on and off, but radiou buttons only turn on. This actually makes radio buttons easier.
So you need to put the script for changing visibility into every radio button in the group. Do not test for any values. Just put the show or hide code into the appropriate button.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now