JQuery autocomplete field

I am using jQuery

autocomplete

. The user enters a name college

, and the auto-complete feature displays a list of similar colleges that they have entered. It works fine. The only problem is I want to disable the user from logging into any other college other than the ones shown in the autocomplete dropdown menu. I want to say that I want the user to select , from the available list, he cannot enter any other text in the field. It will enter the text for which autocomplete will display the results, and then select from that list. Currently, the user can enter a search string, select from the results, and then change the field. I do not want it.

How can i do this? Currently relevant html

:

<div class="ui-widget txt-fld">
   <label class="labelname">College:</label>
   <input id="college" class="textinput" name="college" />
</div>

      

+3


source to share


2 answers


I know of one universal choice that has worked for me over and over again. Look at this:

http://ivaynberg.github.com/select2/



maybe this will help you.

+2


source


You need a picklist to search (or a dropdown to search). If you do not allow modification, it can no longer be considered autocomplete.

The following plugin will work for you.



http://jsearchdropdown.sourceforge.net/

0


source







All Articles