mercredi 8 avril 2015

AutoComplete no search results

I need to change the value of a hidden value, depending if the search of the autocomplete had any results. I know that the ui-autocomplete displays a span that is something like this:



<span role="status" aria-live="polite" class="ui-helper-hidden-accessible">1 result is available, use up and down arrow keys to navigate.</span>


I need to know the results of the search when I am using a onChange event in an input.


My code has to be something like this:



function onChangeHiddenValue() {
if(search == 'No results) --> I need to change this
{
document.forms['form'].elements['hiddenId'].value = cliente.id;
}
else
{
document.forms['form'].elements['hiddenId'].value = null;
}
}




Aucun commentaire:

Enregistrer un commentaire