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? Quote Link to comment Share on other sites More sharing options...
haku Posted June 19, 2008 Share Posted June 19, 2008 Are you getting the alert message? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.