JavaScript code returns false, but still the form is submittted
问题 I have a form with JavaScript validation. Upon there being an error, the submit button should 'grey-out' and the form should not be submitted. However, the last couple of functions seem to submit the form even though they pop the alert box. Why? Button code: <input type="submit" name="button" id="button" onclick='return formvalidation();' value="Next" /> Non-working function example: function BlankSite() { var SiteNum= document.getElementsByName("sitesinput")[0].value; if ((SiteNum == "") ||