For browsers dat do not support scripting, the button needs to be a submit button (otherwise, they would have no way to send the form).
For browsers that do support script, the form is submitted after validating that all fields were entered correctly.
If not, submitting the form must be canceled.
How do I cancel submitting a form without refreshing my page?
// If anything is wrong in the form, it needs to be
// NOT submitted, so there must be code to CANCEL
// submitting a form!!
<form action="some-action.cgi" method=post onsubmit="submitForm()">
<input type=text name="userEntry">
<input type=submit value=submit>