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
1320
WebDropDown Do a postback only after <enter> hit
posted

Hello,

I want that the web WebDropDown  do a postback only when the <enter> key is pressed. Ho to do this please ?

Parents
No Data
Reply
  • 49378
    Verified Answer
    posted

    Hi gtarek,

    Thank you for posting in the community.

    In this scenario you may use the InputKeyDown clientside event in order to initiate a callback should the enter key be pressed:

    Code Snippet
    1. function WebDropDown1_InputKeyDown(sender, eventArgs)
    2. {
    3.     if (eventArgs.get_browserEvent().keyCode == 13) {
    4.         //initiate an asynchronous callback
    5.         var callbackObject = sender._callbackManager.createCallbackObject();
    6.         sender._callbackManager.execute(callbackObject);
    7.     }
    8. }

    Please let me know if this helps.

Children