I have a problem with my jsp file... inside it I have a form and in that form I have an onsubmit method that is basically calling a javascript... the problem is that whenever I click on a button it always redirects me to the page, whether it's true or false
+1
A:
You probably need to return false after the javascript processing which is bound on the button click.
cherouvim
2009-12-10 18:40:33
+1
A:
what cherouvim said.
also, in the case that the onsubmit handler already should be returning false, if there's any javascript error in the handler, then the return statement may never get evaluated and the form will submit.
jonnyheadphones
2009-12-10 20:48:05
+1
A:
You likely have something like:
<form onsubmit="someFunction()">
instead of
<form onsubmit="return someFunction()">
Fix it accordingly.
BalusC
2009-12-10 22:36:05