I'm using a custom button to submit my forms but want to take advantage of the HTML 5 validation. How can I trigger this validation prior to posting the data. I have two separate forms and would like to check the validation on both.
I see that the button has to reside in the form (prior to the close tag) in order for the validation to be triggered. Was wondering if there was a best practice is to do this?
This triggers the validation when added inside the form
<form>
...
<button id="submitbutton" class="btn btn-warning" value="Submit" name="submit" type="submit">Submit</button>
</form>
I have one submit button for two forms.
Thanks, M