views:

57

answers:

0

I've got some jQuery code written to enable autocomplete on an input field.

I'm having two issues with it that I can't seem to fix.

  1. Tabbing away from the field will not populate the input. What I need is for either the FIRST suggestion to populate the field if nothing is selected(clicked or selected via up/down) OR for the highlighted item to be populated in the field. (note: highlighting is done via up/down arrows)
  2. When using the up/down arrows I need the input to display the "LABEL" and not the "VALUE" Currently pressing up/down will populate the input the the VALUE.

Any advice will be greatly appreciated.

Here is my JSBIN testing ground.
http://jsbin.com/iyedo3/2

Note: the <input id="dummy" /> field is just there to give you something to "tab" over to. If it's removed the help area is expanded.