1var $myForm = $('#myForm');
2
3if(! $myForm[0].checkValidity()) {
4 // If the form is invalid, submit it. The form won't actually submit;
5 // this will just cause the browser to display the native HTML5 error messages.
6 $myForm.find(':submit').click();
7}