How do I disable element so it will not submit when clicking on it (but make sure javascript events still work)? "Disabled" attribute turns javascript off.
+1
A:
Add return false;
to the Javascript event handler.
(or e.preventDefault(); e.returnValue = false;
)
SLaks
2010-05-21 16:10:12
I did this but there was no effect.
Aliens
2010-05-22 17:28:12
Oh it works now. The only thing I needed to figure out myself was place a word return before the javascript function name in html attribute onClick.
Aliens
2010-05-22 17:34:53
+1
A:
Another option is to not make it a submit button
<input type="button" value="Button Text" onclick="myHandler()" />
Seattle Leonard
2010-05-21 16:14:45