Microsoft
Software
Hardware
Network
Question : How do I prevent a Submit if input validation fails?
If I'm doing input validation behind a HTML submit button, and the validation fails, how do I prevent the "submit"? Doing my input validation in the click of the submit button, is this the "correct" way to do it?
Thanks.
Answer : How do I prevent a Submit if input validation fails?
suppose validatePage() is your javascript function and it should return true or false.
then in your button onclick event you have to put onclick="return validatePage();"
then if the function returns false then your submit never hits.
Random Solutions
Need help with important safety precautions!
Add Mirror Greyed Out
Can't access Exchange 2003 OWA from Internet
Windows XP problems after a hard drive clone of a bad drive
Websense - Block Internet Access - Except for Updates
Gracefully shutting down VMs before ESX hosts shutdown in vSphere
SSAS 2008 MDX All Member Before Current Member
Installing public SSL for Exchange 2007 server
What is the Best Digital Camera, that is tiny, takes video and takes great pictures?
Autocorrelation: Durbin-Watson tests