PDA

View Full Version : onClick question


gymshoe
08-28-2001, 12:34 AM
alrighty...i have a form that has an onClick command tied to the submit button. So when you click the Submit button with the mouse it will call whatever stuff i have declared for the onClick event.
So far so good.
In IE it allows a user to use the keyboard's enter/return key as a substitute for using the mouse and clicking the submit button.
However, when i hit the enter/return key, the onClick even never happens and thus the stuff i have declared for the onClick event never gets called and my stuff doesn't work the way it's supposed to.

So I'm wondering....how do I handle this?
i've tried onSubmit (or onsubmit) ......which i thought would work..but it doesn't.

Thanks for your help in advance!

-James

bturner
08-28-2001, 12:34 PM
One way you could do it is, instead of using a SUBMIT button for the form, is to use a INPUT TYPE=BUTTON, and then the user would have to click on the button to submit the form.

Boy, that sounds confusing.

If you use the BUTTON form object, you can then use your onclick function for validation or whatever, and then at the end of that function add a document.FORMNAMEHERE.submit(); to submit the form.

Hope that helps, if not, I can try and make this more clear.

Bill