When using the jquery ui autocomplete combobox, can you set a default value for the combobox?
input.val( $(select).children("option:selected").text());
I used the below line of code instead, just another way of achieving the same result :)
$('option:selected', this.element).text()
You can achieve this by editing the following statement of the auto-completer:
value = selected.val() ? selected.text() : "Select Institution";
I've tweaked the responses here to use the select variable already defined by the combobox to find the selected option and use that. This means it is generic for which ever element you have defined the combobox on (using id, class or selector ) and will work for multiple elements also.
input.val(select.find("option:selected").text());
Hope this helps someone!
I have an answer that worked for my implementation of the jquery UI combobox. Somewhere in the middle of the code was this:
.val(value)
I changed it to:
.val(select.val())
and presto, the initial value of the underlying textbox appeared. Seems to me like this should be the default functionality, but what do I know?
may be this will help you
http://forum.jquery.com/topic/autocomplete-default-value