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
228
Capture key press in web drop down
posted

Hi,

I have my web drop down configured for auto filtering on the client, and I want to trap when the user presses the enter key and force the drop down to close when this happens.

My first thought was doing so with this script:

 

function wdd_ValueChanging(sender, eventArgs) {

    window.status = eventArgs.get_browserEvent().keyCode;

    if (eventArgs.get_browserEvent().keyCode == 13) {

        sender.closeDropDown();

    }

}

tied to the 'ValueChanging' client side event property of the web drop down.
The status bar will display all of the values for what I am typing except for the enter key, so something else is capturing when the enter key is tapped.
Is there a different way to get the drop down to close when the user presses the enter key?