jquery - Overriding keypress event during autocomplete select event -



jquery - Overriding keypress event during autocomplete select event -

$('#myfield').autocomplete({ select: function(event, ui) { var selectedobj = ui.item; $('#fieldtoset').val(ui.item.id); $('#fieldfornextfocus').focus(); }

i using autocomplete, , wanted jump field after finish event. set focus(). but, set focus fires first, , keypress event triggered autocomplete fires. if user autocompleted come in key or mouse click, fine, if used tab select item, set focus new field , tab execute, taking them 1 field far..

i tried inserting:

event.preventdefault();

after set focus() stops field populating on click event reason. so, think need phone call event.preventdefault() if 'tab' key pressed autocomplete select method fire. can't figure out how find out pressed within of select.

jquery autocomplete tabs keydown preventdefault

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -