Skip to main content

Search and Top Navigation

#5757 closed enhancement (fixed)

Opened June 23, 2010 12:08PM UTC

Closed October 20, 2010 04:00AM UTC

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

From http://forum.jquery.com/topic/autocomplete-combobox-from-documentation-bugs:

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.

Attachments (0)
Change History (8)

Changed June 23, 2010 02:29PM UTC by jzaefferer comment:1

description: From http://forum.jquery.com/topic/autocomplete-combobox-from-documentation-bugs: \ \ {{{ \ 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.From http://forum.jquery.com/topic/autocomplete-combobox-from-documentation-bugs: \ \ {{{ \ 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.

Changed June 24, 2010 11:31AM UTC by gavimobile comment:2

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 $_POST['combobox_field'];

thanks

Changed July 20, 2010 06:50PM UTC by scottgonzalez comment:3

Fixed initial value in 123467a.

Changed July 20, 2010 07:15PM UTC by scottgonzalez comment:4

Fixed form submission in e85615f.

Changed July 20, 2010 07:18PM UTC by scottgonzalez comment:5

resolution: → fixed
status: newclosed

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

$("#combobox").next().val("java").blur();

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

Changed August 04, 2010 01:30AM UTC by scottgonzalez comment:6

milestone: 1.91.8.3

Changed October 20, 2010 03:35AM UTC by dvdckl comment:7

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?

Changed October 20, 2010 04:00AM UTC by scottgonzalez comment:8

resolution: → fixed
status: reopenedclosed

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