I have field that is set with a "numeric" constraint and client-side validation. There is a button on the form that fires 3 events: an AJAX Submission, and 2 Group Toggles to hide the current form and display a hidden form. The AJAX Submission has the Validation Indicator checked.
When the button is clicked, the validation happens properly, but the following events are also fired, which hides the form with the error.
How do I get the events to stop firing after the validation fails? Thanks.
When the button is clicked, the validation happens properly, but the following events are also fired, which hides the form with the error.
How do I get the events to stop firing after the validation fails? Thanks.
RE: Stop firing events on validation failure
Add this new action before your existing ones, and use the following script:
if (!hyf.validation.validateForm()) return;
If there are validation errors this should return to stop any future actions from being processed. There are details on this validation function in this thread.
You will probably also want to turn off the validation indicator on you AJAX Submission action so that you are not validating twice.
RE: Stop firing events on validation failure
That's exacly what I was looking for. Thanks.
RE: Stop firing events on validation failure
The user can define a "IF" condition for an Event to check to see if the entire "Form Validates" or a particular "Group Validates".