That callback is passed (among other things) the submit event object. Just
call .preventDefault() on it.

On Fri, Mar 2, 2012 at 11:45 AM, batman42ca <[email protected]> wrote:

> I'm using the mootools form validation.
>
> I have a form where there is a field that is potentially not required.
> Depending on the selected country, the prov/state might legitimately
> be left blank but might be required for other countries. I'm not
> personally interested in being responsible for figuring out which
> countries won't have a province or state.
>
> So, I thought, a simple solution would be not to make the prov/state a
> required field, then in the onFormValidate function if the rest of the
> validation passed, show the user a javascript prompt box giving the
> user a 2nd chance to enter a prov/state or proceed with a blank value.
>
> At that point, the user might decide to cancel the form submission (by
> clicking the cancel button in the javascript prompt box). If so, how
> do I stop the form submission from within my onFormValidate function
> if I detect the user pressed the cancel button? Is it as simple as
> returning false from my onFormValidate function? Does it even make
> sense to set a return value?
>

Reply via email to