I want to check to make sure a field is filled in before the form will submit.
I have this:Which works when called by this, except that the form still gets submitted when the error message pops up:Code:function checkforinitials() { if (document.dform.INIT_BADGE.options[document.dform.INIT_BADGE.selectedIndex].value == 'na') alert("Please fill in your initials at the top of the form!"); return false; }
However, the submission is done via PHP. How do I stop the page from going through the submission when they haven't filled that item in?Code:<form name='dform' action='submitcal.php' method='post' onsubmit='checkforinitials();'>


Reply With Quote