I am using this code for an HTML form and I am using Javascript to do form validation: <form name = "Reginfo" method="post" action="/cdcsreg/procdata.php" onSubmit = "return verify_data();"> In the "verify_data" script it processes the instructions when I use Firefox and the processing stops, like it should. However, when I use IE the processing continues to "procdata.php". What could be wrong?
IE sux You can cheat a little, and use a plain button, instead of a submit button. and call the javascript using the onclick method. in your function you could then add code to either submit the for or display and error message like this: if( code to check if form is valid){ document.getElementByName("RegInfo").submit(); }else{ alert("you didn't do something right"); }
I totally agree. I don't really try to even support it anymore when creating scripts. IE 9, though, is MUCH better.
I think the problem is in the code of the verify_data(). Possibly it return true somehow in IE and it sends the form to the server.