means that if checkForm returns false (which it does when form.frmForename.value == ""), then the false is used with the return in return checkForm() and the click event is cancelled, so the form does not submit. Then checkForm2() is called, but by then the button click has already been cancelled.
Also, there is no need to separate each function into its own <script> element. You should also be working with the form.submit event, rather than the button.click event and you should not be using inline event handlers (on...), but rather with standard element.addEventListener().
Asked in February 2016Viewed 2,999 timesVoted 14Answered 1 times