[thelist] Stopping a user submitting a form from the address bar using JS.
Craig
cd-ml at aardvark.net.au
Fri Dec 13 07:44:01 CST 2002
Hi
I've got a form on a page that uses JavaScript to validate the input. This
form is submitted with a button calling a JS function:
<input type="button" value="Submit"
onClick="check(form,form.elements.length);">
The button is not a 'submit' button because after the script has validated the
input, the script itself submits the form. However, if I open up this page in
a browser (IE6) and type 'javascript:document.forms[0].submit()' (without the
'), it will bypass the validation and submit the form. How can I stop this?
Thanks for any help,
Craig.
More information about the thelist
mailing list