|
I can't say for certain, but I was never able to find away around this. Even if you intercept the enter key-press event, the form will still submit.
I had an idea that might work -- don't include a submit button. My theory is that the enter key actually activates the submit button (which is treated as the default button) rather than submitting the form directly. If you just put in a regular button and have it call a javascript function to submit the form, it might work -- I haven't had a chance to test it.
A more drastic solution (if that doesn't work) would be to put the input boxes on the page, but not in a form. When you're ready for the user to submit, you could transfer the values to hidden fields in a form and submit that. Another alternative along the same lines might be to have the input boxes in a form, but don't give the form an action; use javascript to assign an action to the form and submit it.
Short of that, I don't know of any way to make a browser not treat the enter key as a submit action.
|