Copy link to clipboard
Copied
I have 2 dropdowns.
and a submit button.
I want it to test if an item from the drop downs were selected.
The option displaying is 'Click for more options'
So check to see if it says 'Click for more options' ---- if 'Click for more options' is still showing, generate a message to say, please choose from the list.
Because these fields are required, it needs to test for a valid selection....
Copy link to clipboard
Copied
Setting event.rc as false won't work. You need to remove the Submit Form command and do it all in your script.
Copy link to clipboard
Copied
If a field is marked as "required", then the submit is blocked when it's value matches the default value. So this is one way to block the submit, i.e. set the dropdown default value to "Click for more options".
But to display an alert message a script will need to be used to test the dropdown.
Add a "run a script" action to the submit button. Here's a sample:
if(this.getField("dropdown").value == "Click for more options")
app.alert("Please choose an option from the dropdown");
You'll also need to either perform the submit in the same script or set the dropdown default value to "Click for more options" to block the submit.
Copy link to clipboard
Copied
Hi, I have this and it works except, in the actions tab, I have the submit form, it still activates after clicking ok on the msg box. Did I forget to close something. I am also using it on 2 dropdowns.
if (this.getField("typeofestablishment").valueAsString=="click for more options") {
app.alert("Please select a valid Choice Number 5");
event.rc = false;
}
else if (this.getField("typeoflossortheft").valueAsString=="click for more options") {
app.alert("Please select a valid Choice Number 6");
event.rc = false;
}
Copy link to clipboard
Copied
Setting event.rc as false won't work. You need to remove the Submit Form command and do it all in your script.
Copy link to clipboard
Copied
I will give it a try.