Confusing title, I know. I'll try to word this as best as I can.
What I have
A large form made up of multiple sections. Only one section is visible at one time, and clicking the Continue button just displays the next part of the form using javascript. Some inputs contain the type='email'
attribute.
What I want to happen
When the user clicks a Continue button, I want the browser to think the form is being submitted so it does its checks on the type='email'
inputs and displays a message if the input is not valid, just like this.
But I do not want it to submit the form when the Continue button is clicked.
EDIT: Sorry, I forgot to add that I also need the form to submit at the end. So I cannot use the onsubmit='return false'
approach.
What currently happens
At the moment, the browser validation activates when I click the final Submit button (because the form is actually being submitted). But this is too late because the form sections are all closed now, and users will not be able to see which input needs attention.