G
Guest
How do I prevent users from submiting a form if they press the enter key. I
saw a script to disbale the enter key but I forget where. Any suggestions?
saw a script to disbale the enter key but I forget where. Any suggestions?
Steve said:How do I prevent users from submiting a form if they press the enter
key. I saw a script to disbale the enter key but I forget where. Any
suggestions?
AMysticWeb said:Hi Steve,
http://frontpageforms.com/disable_enter.htm
Mike Smith,
http://FrontPageForms.com
FrontPage Form Tutorials
& Form Script Examples
Andrew said:A good way of preventing the form being submitted before the last
field if they press Enter in error, is to make the last field
"required", so it won't submit until they fill in the last field.
I believe there are also scripts around that make the Enter key
behave like the [Tab] key, that is it advances to the next field,
then the user clicks "Submit" rather than pressing the Enter key. Else
make it plain they have to press TAB to go to the next field,
not [Enter].
Trevor said:Does anyone out there know of such a script?
I suppose it would be like the one on
http://frontpageforms.com/disable_enter.htm
but with a small change
e.g.
function checkCR(evt)
{
var evt = (evt) ? evt : ((event) ? event : null)
var node = (evt.target) ? evt.target : ((evt.srcElement) ?
evt.srcElement
if ((evt.keyCode == 13) && (node.type=="text"))
{ evt.keyCode = xx
// where xx is the keycode for Tab
return true } // is this correct?
}
document.onkeypress = checkCR
Any ideas, people out there
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.