T
Tim Streater
I have a form and a button to submit it. The button is made from:
<input type=button onclick='myHandler(this.form);'>
This all works fine except that in Safari 2.0.4, the enter/return keys,
if pressed, submit the form - bypassing my onclick handler.
I can partially fix this with:
<form onsubmit='return false;'>
except that if at the time enter/return is pressed, the focus is on one
of the iframes in my form, then the iframe gets reloaded (with goofy
parameters, of course). If the focus is nowhere when enter/return is
pressed, then these get ignored OK.
Note that with Firefox Mac and any WIndows browser, return seems to be
ignored.
How can I prevent Safari from submitting the form when enter/return are
pressed?
Thanks,
<input type=button onclick='myHandler(this.form);'>
This all works fine except that in Safari 2.0.4, the enter/return keys,
if pressed, submit the form - bypassing my onclick handler.
I can partially fix this with:
<form onsubmit='return false;'>
except that if at the time enter/return is pressed, the focus is on one
of the iframes in my form, then the iframe gets reloaded (with goofy
parameters, of course). If the focus is nowhere when enter/return is
pressed, then these get ignored OK.
Note that with Firefox Mac and any WIndows browser, return seems to be
ignored.
How can I prevent Safari from submitting the form when enter/return are
pressed?
Thanks,