Opened 7 years ago

Closed 6 years ago

#5757 closed enhancement (fixed)

Autocomplete combobox issues

Reported by: jzaefferer Owned by:
Priority: minor Milestone: 1.8.3
Component: ui.autocomplete Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by jzaefferer)


The autocomplete combobox has the following bugs:

   1. submits forms when you select an item
   2. does not take into account the initially selected option
   3. you cannot set the value of the combobox programatically

I solved these issues and the code I added will work for jQuery ui 1.8.

Note: I also have a 'set_empty' call that will only set the combobx if it is empty.  I was using this for starting with a value if one had not been previously set.  Feel free to rip it out if you don't want/need it.

Initializing the input with the value of the select is a no-brainer. Need to look at the others. The provided implementation would need to be refactored to use the set-method in the select-event.

In Chrome 5, enter a charakter and backspace: The resulting menu gets way too wide.

Change History (8)

comment:1 Changed 7 years ago by jzaefferer

  • Description modified (diff)

comment:2 Changed 7 years ago by gavimobile

can you give us a full working example.

i applied the code and it works but i want to POST values which arent in the dropdown and get the value with php. eg. echo $_POSTcombobox_field?;


comment:3 Changed 7 years ago by scottgonzalez

Fixed initial value in 123467a.

comment:4 Changed 7 years ago by scottgonzalez

Fixed form submission in e85615f.

comment:5 Changed 7 years ago by scottgonzalez

  • Resolution set to fixed
  • Status changed from new to closed

Please open separate tickets for any remaining features. For setting a value programmatically, you can currently do:


We can flesh out more functionality when this is an actual plugin and not just a demo.

comment:6 Changed 7 years ago by scottgonzalez

  • Milestone changed from 1.9 to 1.8.3

comment:7 Changed 6 years ago by dvdckl

  • Resolution fixed deleted
  • Status changed from closed to reopened

This commit broke the use case where the user is allowed to submit text by hitting enter in order to ignore search suggestions shown in the autocomplete widget: e85615f

Is there a recommended workaround? Can we make this behavior an option of autocomplete?

comment:8 Changed 6 years ago by scottgonzalez

  • Resolution set to fixed
  • Status changed from reopened to closed

That change has actually been reverted in master and will go out with 1.8.6.

Note: See TracTickets for help on using tickets.