jquery - jQueryUI autocomplete+Combobox widget is focused when hitting return on other elements -
I use the jqueryUI AutoComplete + Combobox widget in a form with multiple inputs.
When I return the tabs and hits to a checkbox, I get an immediate focus on the combobox generated input element. It is on each input element but not on the selection.
How can I avoid it?
(Tab on the second checkbox hit return)
Code:
You can use e.preventDefault () or to prevent this default Behavior can return false:
$ ('input [type =' checkbox "] '). Keydown (function (e) {if (e.keycode == 13) {if ($: ''). (': Check')) {$ (this) .prop ('check', wrong) checkboxDrive ("refresh");} and {$ (this) .prop ('checked' True);} return false;}});
Comments
Post a Comment