Copy link to clipboard
Copied
Hello,
I need javascript code to reset a dropdown box to the default value ("Make Selection") if the "No" radio button is checked and "Reconciliation" is selected in the dropdown box. The dropdown box values are "Make Selection, January, February, March, April, May, June, July, August, September, October, November, December, and Reconciliation". Also, need an error message stating "Please select a valid month" to pop up.
Use this code as the custom validation script of the drop-down field:
if (this.getField("Full Year Reconciliation").valueAsString=="No" && event.value=="Reconciliation") {
app.alert("Please select a valid month");
event.rc = false;
}
Copy link to clipboard
Copied
The dropdown box name is "Month Reporting". The radio button name is "Full Year Reconciliation"
Copy link to clipboard
Copied
Use this code as the custom validation script of the drop-down field:
if (this.getField("Full Year Reconciliation").valueAsString=="No" && event.value=="Reconciliation") {
app.alert("Please select a valid month");
event.rc = false;
}
Copy link to clipboard
Copied
Awesome! Works perfect. Thank you!
Copy link to clipboard
Copied
What can I add to this validation script to bring the dropdown box to its default value if the "Yes" radio button is checked and "Reconciliation" is not selected in the dropdown box? Also, will need an error message to pop up stating "Please select "Reconciliation" in Month Reporting drop-down box".
Thanks!