Search code examples
javascripthtmljqueryformsvalidation

Trigger standard HTML validation (form) without using submit button?


Anyone who know how I can trigger the standard HTML5 validation in a form without using a submit button? (JavaScript or jQuery).

I do not want to send POST/GET request, only do the validation.


Solution

  • The accepted answer to this question appears to be what you're looking for.

    Short summary: in the event handler for the submit, call event.preventDefault().