Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
Capture KeyPress event in javascript for FireFox
posted

I am trying to capture the keyCode on the KeyPress Event client side.
If I use

function IgnoreEnter(keyCode) {
    if (event.keyCode == 13) {
        event.returnValue = false
        event.cancel = true
        return true
    }
    else {
        return false
    }
}

it is not capturing the keycode event.  I need to pass the event, which I am not sure how to do that. 
Using <ClientSideEvents KeyPress="IgnoreEnter"  KeyDown= "IgnoreEnter"/> does not capture the event in Firefox.  How do I capture the event?

Thanks.

 

Parents
  • 49378
    Verified Answer
    posted

    Hi khoke,

    Thank you for posting in the community.

    From what I can see you want to cancel the postback upon clicking the Enter key while in edit mode. You should be able to do that by setting the HideEnterKey property to True and the EnterKeyDown postback flag to Off.

    Note that with this setup the Enter key would also not trigger the KeyPress client side event.

    Please let me know if this helps.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://es.infragistics.com/support

Reply Children