astralaaron Posted October 7, 2008 Share Posted October 7, 2008 does anyone know why when this returns false it still loads the next website?on my form i used onsubmit="validate();" function validate() {var theMessage = "The following errors occured: \n-----------------------------------\n";var noErrors = theMessage;if (document.adduser.nm.value == "Account Name") {theMessage = theMessage + "\n --> You must enter a User Name";}if (document.adduser.pw1.value == "Account Password" || document.adduser.pw2.value == "Repeat Password") {theMessage = theMessage + "\n --> You must enter and repeat a password";}if (document.adduser.pw1.value != document.adduser.pw2.value) {theMessage = theMessage + "\n --> Password fields do not match";}if (theMessage == noErrors) {return true;} else {alert(theMessage);return false;}} Link to comment Share on other sites More sharing options...
justsomeguy Posted October 7, 2008 Share Posted October 7, 2008 onsubmit="return validate();" Link to comment Share on other sites More sharing options...
astralaaron Posted October 7, 2008 Author Share Posted October 7, 2008 onsubmit="return validate();"thanks man Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.