dezkit Posted June 19, 2008 Share Posted June 19, 2008 My form doesn't submit if it is validated. function checkpostal(){ var themessage = "You are required to complete the following fields: "; var re5digit="STEAM_[0|1]:[0|1]:[0-9]+"; if (document.form.os1.value.search(re5digit)==-1){ alert('Please enter a valid SteamID.\nSteamID has to be in the form of "STEAM_0:x:xxxxx"'); } else { return true; } } anyhelp? Link to comment https://forums.phpfreaks.com/topic/110852-solved-form-doesnt-submit-if-validated/ Share on other sites More sharing options...
haku Posted June 19, 2008 Share Posted June 19, 2008 Are you getting the alert message? Link to comment https://forums.phpfreaks.com/topic/110852-solved-form-doesnt-submit-if-validated/#findComment-568801 Share on other sites More sharing options...
xtopolis Posted June 19, 2008 Share Posted June 19, 2008 I think on the form you would add <form onsubmit="return checkpostal()" name="steamid_form"> and in function checkpostal() you would have document.steamid_form.submit() instead of return true; if anything, I would think that you would need the "return checkpostal()". We would need to see the form code to be sure, and test ourselves. Link to comment https://forums.phpfreaks.com/topic/110852-solved-form-doesnt-submit-if-validated/#findComment-568841 Share on other sites More sharing options...
dezkit Posted June 19, 2008 Author Share Posted June 19, 2008 <SCRIPT TYPE="text/javascript"> function checkpostal(){ var themessage = "You are required to complete the following fields: "; var re5digit="STEAM_[0|1]:[0|1]:[0-9]+"; if (document.form.os1.value.search(re5digit)==-1){ alert('Please enter a valid SteamID.\nSteamID has to be in the form of "STEAM_0:0:123456"\nIf you do not know how to find your SteamID, press on the HELP? link.'); } else { document.form.submit() } } </script> solved. Link to comment https://forums.phpfreaks.com/topic/110852-solved-form-doesnt-submit-if-validated/#findComment-569471 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.