I’m writing form and adding html5 validation attributes to its input like “required”, “autofocus”. I use Javascript to submit the form using document.myForm.submit() but it doesn’t validate the form against the html5 validation attributes as they aren’t there.
Any Suggestions?
It appears that triggering a
clickon the submit button does have the correct effect: http://jsfiddle.net/e6Hf7/.and in case you don’t have a submit button, add an invisible one like: