JS call after successful validatino
-
Currently we have the option to enter HTML/JS code on the form itself, and the option to have an ‘onSubmit’ call for the Submit button on the Advanced tab.
The problem is that the onSubmit is called regardless of validation. So if someone does not complete the form or if it doesn’t validate, than the submit will still run the script. But I only want the script to run after the form is complete and sent.
I could instead put my script in the HTML/JS free entry, but I don’t know what the event is to run it. I would normally use an EventListener for submit, but this doesn’t mean it was validated.
In short, is there a specific action that reports that the form is validated and good to be sent?
Here is the script in question:
document.getElementById("myform").addEventListener("submit", function(evt) { evt.preventDefault(); setTimeout(AoProcessForm(this), 0); }, true);
Thank you!
- The topic ‘JS call after successful validatino’ is closed to new replies.