I am using jquery autocomplete combobox , and its all working great.
Visit http://jqueryui.com/demos/autocomplete/#combobox .
The issue is , I want make this combobox such that upon clicking in the box the text inside get selected, so that the user can start searching for next without clearing old text.
solution I tried for testing on $(document).ready…
//clear each option if its selected
$('#<%=combobox.ClientID %> option').each(function () {
$(this).removeAttr('selected')
});
//set the first option as selected
$('#<%=combobox.ClientID %> option:first').attr('selected', 'selected');
//set the text of the input field to the text of the first option
$('#<%=combobox.ClientID %> ').parent().children('input.ui-autocomplete-input').val(' ');
dint work …
Thanks in advance for your help.
$.select() is what you need. In your particular case do this when you build the autocomplete box: