Forums

Double Drop Down using Ajax

dbrody 28 Feb, 2012
I'm following the how to doc "Build a double drop-down' using Ajax". Everything works fine, but wanted to add another feature. Currently, if form can't find the state id, it will output "Sorry, we can't find that state" - however it still allows the person to submit the form. How would we stop the submission.

Our form is a little different than the one in the example. Instead of a dropdown box, we use a textbox with an onblur event that triggers population of the "2nd" dropdown. If someone doesn't enter in a valid value for the textbox, we want to prevent the submission of the form. (i.e. the 2nd dropdown has nothing in it, so it should just stop).
GreyHead 28 Feb, 2012
Hi dbrody,

You could add validation to the text box; or maybe a script to disable the Submit button unless there is a selection made on the second drop-down ??

Bob
This topic is locked and no more replies can be posted.