Panjabel Posted September 23, 2008 Share Posted September 23, 2008 <script language="javascript"> function validate(){ if (document.myform.ss1.value == "") { alert("empty field"); return false; } </script> <form name="myform" method="post" onsubmit="return validate()"> <input type="text" name="ss1" id="ss1"> <input type="submit" value="submit"> </form> ??? ??? ??? ??? Link to comment https://forums.phpfreaks.com/topic/125416-solved-please-help-whats-wrong-here/ Share on other sites More sharing options...
JasonLewis Posted September 23, 2008 Share Posted September 23, 2008 Make you're script this: <script language="javascript"> function validate(){ if (document.myform.ss1.value == "") { alert("empty field"); return false; }else{ return true; } } </script> You're missing the closing of the if statement, I also added an else and returned true. Link to comment https://forums.phpfreaks.com/topic/125416-solved-please-help-whats-wrong-here/#findComment-648442 Share on other sites More sharing options...
Panjabel Posted September 23, 2008 Author Share Posted September 23, 2008 thanks a lot Link to comment https://forums.phpfreaks.com/topic/125416-solved-please-help-whats-wrong-here/#findComment-648445 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.