Creating hidden/visible fields based on one radio group selection
Hello,
We have a document that works already but needs to add some verabage and i cannot edit the exiting document and i am having to recreate it. The current form works this way but I am trying to do a very simple Radio Buttion option and depending on what option they choose, some fields will appear and others will stay hidden. I am attempting to you this code:
{
// Get the selected value from the radio button group
var selectedValue = this.getField("Selection").value;
// Get the field that will be shown/hidden
var textField = this.getField("Payee Name");
// Show or hide the field based on the selected radio button value
if (selectedValue == "Paper Check") {
textField.display = display.visible; // Show the field
} else if (selectedValue == "ACH") {
textField.display = display.hidden; // Hide the field
} else {
// Optionally, hide the field if no selection is made
textField.display = display.hidden;
}
}
But this is not working. I would like to be able to include all fields that would either disappear or be visible into one script to keep things neat. Thanks in advance
