ShaolinF Posted October 14, 2007 Share Posted October 14, 2007 Hi Guys, What I want is when a user doesnt fill in a field on a form and presses next, I want that page to say 'Error, you have not filled in this field', rather than having to load another page with the comment. How can I do this ? Link to comment https://forums.phpfreaks.com/topic/73182-load-text-in-a-page/ Share on other sites More sharing options...
mattal999 Posted October 14, 2007 Share Posted October 14, 2007 javascript... search on google for: javascript form validation. Link to comment https://forums.phpfreaks.com/topic/73182-load-text-in-a-page/#findComment-369150 Share on other sites More sharing options...
ShaolinF Posted October 14, 2007 Author Share Posted October 14, 2007 Thanks. I managed to find a way but cant get it to work. Here is the thread if you want to give a hand: http://www.phpfreaks.com/forums/index.php/topic,163447.msg716558.html#new Link to comment https://forums.phpfreaks.com/topic/73182-load-text-in-a-page/#findComment-369195 Share on other sites More sharing options...
mattal999 Posted October 14, 2007 Share Posted October 14, 2007 try this instead: <form action="continue.php" method="post" name="signup" onSubmit="return myformcheck()"> <p align="center"> Username: <input type="text" name="name" size="20"><br> Password: <input type="text" name="contact" size="20"><br> E-mail : <input type="text" name="email" size="20"><br> <input type='submit' value='Go'> <script language="Javascript"> function postregister() { if ((document.signup.name.value == '') || (document.signup.contact.value == '') || (document.signup.email.value == '')) { alert('You have to enter a valid name, contact number and email.'); } else { document.signup.submit(); } } </script></form> post back to let me know if it works. Link to comment https://forums.phpfreaks.com/topic/73182-load-text-in-a-page/#findComment-369273 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.