Opened 13 years ago

Closed 13 years ago

#5757 closed enhancement (fixed)

Autocomplete combobox issues

Reported by: Jörn Zaefferer Owned by:
Priority: minor Milestone: 1.8.3
Component: ui.autocomplete Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by Jörn Zaefferer)


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 13 years ago by Jörn Zaefferer

Description: modified (diff)

comment:2 Changed 13 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 13 years ago by Scott González

Fixed initial value in 123467a.

comment:4 Changed 13 years ago by Scott González

Fixed form submission in e85615f.

comment:5 Changed 13 years ago by Scott González

Resolution: fixed
Status: newclosed

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 13 years ago by Scott González


comment:7 Changed 13 years ago by dvdckl

Resolution: fixed
Status: closedreopened

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 13 years ago by Scott González

Resolution: fixed
Status: reopenedclosed

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

Note: See TracTickets for help on using tickets.