window.onload = function () { document.getElementById("frmSubmit").onsubmit = function onSubmit(form) { var isValid = true; //validate your elems here isValid = false;
if (!isValid) { alert("Please check your fields!"); return false; } else { //you are good to go return true; } } }
.