jquery - Prevent enter key from triggering button -
i have search input box when user presses enter needs nothing. using emberjs , jquery below code. works disable pop being triggered reason in ie9 when enter pressed toggle button becomes in focus. works fine in chrome. i've tried tabindex , preventdefault neither trick.
if ($el.hasclass('form-control')) { if ( e.which == 13) { this.get('controller').flipit(); } }
thank you.
edit------
here snippet of page. when user hit enter within search box button right getting highlighted. how prevent this?
do this
$("#inputbox").on('keydown', function(event) { if (event.key == "enter") event.preventdefault(); });
Comments
Post a Comment