vividona Posted September 17, 2011 Share Posted September 17, 2011 Plz help I have a registration form. I need if someone fill something wrong, the form stop sending data without refreshing or losing data Quote Link to comment https://forums.phpfreaks.com/topic/247328-save-data-without-refreshing-form/ Share on other sites More sharing options...
freelance84 Posted September 18, 2011 Share Posted September 18, 2011 Form validation with js. You could use ajax to check the username But you must double check everything on the server before committing any of the data to your database. Quote Link to comment https://forums.phpfreaks.com/topic/247328-save-data-without-refreshing-form/#findComment-1270381 Share on other sites More sharing options...
thatotherguy Posted September 18, 2011 Share Posted September 18, 2011 http://bassistance.de/jquery-plugins/jquery-plugin-validation/ They have a nice documentation so you shouldn't get lost. Your welcome. Quote Link to comment https://forums.phpfreaks.com/topic/247328-save-data-without-refreshing-form/#findComment-1270384 Share on other sites More sharing options...
Irshad Siddique Posted September 18, 2011 Share Posted September 18, 2011 <script type="text/javascript"> function checkfrm() { if(document.myForm.myTextBox.value !="Irshad Siddique") { alert("Wrong Name!"); document.myForm.myTextBox.focus(); return false; } } </script> <form action="" method="POST" name="myForm" id="myForm" onSubmit="return checkfrm();"> <label> <input name="myTextBox" type="text" id="myTextBox" /> </label> <label> <p> <input type="submit" name="Submit" value="Submit" /> </p> <p>Please Write in text box Irshad Siddique and click on button</p> <p>and now write another name and click on button and see the results </p> </form> Quote Link to comment https://forums.phpfreaks.com/topic/247328-save-data-without-refreshing-form/#findComment-1270385 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.