Friday, 13 September 2013

Jquery mobile Autocomplete not repeating search for same term again

Jquery mobile Autocomplete not repeating search for same term again

I have created an autocomplete using an example given in the Jquery mobile
site then to set the data from the list i just create an click event in
the li tag so that when a search list is created it will set the selected
list data to input text. Its working fine but when i tried to repeat the
search by deleting the same name for the first time it shows the search
list and if user select the same name and again delete last character but
this time it does not show the search list.Can any one tell me how can i
make it work. here is the code i had written for onclick:
$("#autocomplete").delegate('li','click',function(){
var ul_Id = $(this).parent('ul').attr('id');
var textval = $(this).text();
$('#'+ul_Id).prev('form').find('input').val(textval);
$.mobile.activePage.find("[data-role =
listview]").children().addClass('ui-screen-hidden');
}
Thanks in advance.

No comments:

Post a Comment