| re: Need to ignore Enter key in Form
try this, in the function:
// cancel the default submit
event.returnValue=false;
event.cancel = true;
masoud
"Lars Netzel" <lars.netzel@NO-SPAM.qlogic.se> wrote in message
news:uX67IDzHFHA.588@TK2MSFTNGP15.phx.gbl...[color=blue]
> I really need to stop users from reposting the form with Enter or Return
> keys. It bypasses so many onClick validations that nothign works if they[/color]
use[color=blue]
> Enter. I must force the user to CLICK on the "Save" button on my aspx page
> and instead totally ignore the Enter Key.
>
> I figured I could use this code
>
> function EnterKeyPress(){ if (window.event.keyCode==13){ alert('No Enter
> please'); return false; } }
>
> and call that from
> <body onkeydown="javascript:EnterKeyPress();">
>
> But that doesn't work.. sure it triggers but it still makes the page
> postback.
>
> OR.. any better solution that I'm not bright enough to think of is[/color]
welcomed![color=blue]
>
> please help/
> Lars
>
>[/color] |