<script> function checkforblank() { var errormessage = ""; if (document.getElementById('emailemail').value == "") { errormessage += "Enter your email \n"; document.getElementById('emailemail').style.borderColor= "red"; } if (document.getElementById('name1name1').value == "") { errormessage += "Enter your first name \n"; document.getElementById('name1name1').style.borderColor= "red"; } if (document.getElementById('name2').value == "") { errormessage += "Enter your last name \n"; document.getElementById('name2').style.borderColor= "red"; } if (document.getElementById('address').value == "") { errormessage += "Enter your address \n"; document.getElementById('address').style.borderColor= "red"; } if (document.getElementById('city').value == "") { errormessage += "Enter your city \n"; document.getElementById('city').style.borderColor= "red"; } if (document.getElementById('state').value == "") { errormessage += "Enter your state \n"; document.getElementById('state').style.borderColor= "red"; } if (document.getElementById('zip').value == "") { errormessage += "Enter your zip \n"; document.getElementById('zip').style.borderColor= "red"; } if (document.getElementById('phone').value == "") { errormessage += "Enter your phone \n"; document.getElementById('phone').style.borderColor= "red"; } if (errormessage != "") { <!-- if it is not empty --> alert(errormessage); return false; <!-- Makes Script not submit, or paused --> } } </script> Code (markup): onsubmit="checkforblank()" Code (markup): it does seem to work just fine, it pulls the pop up message but when you hit okay. it takes them to the next page no matter what?
fixed issue, but if someone were to enter in the fields and press submit it does nothing. they would have to refresh the page...?
Yeah, this is kind of another case of "if we can't see the HTML the script is doing stuff to, we can't tell you what's wrong" CSS without the HTML it's working on is gibberish... Javascript without the HTML it's working on is gibberish, etc, etc...