I'm using jQuery in my project and I need to implement autocomplete, but I'd like to avoid including jQuery UI widget, and hopefully use some specific external plugin. Could you please provide some examples/link? I have to query a remote JSON source that returns key-value couples.
Autocomplete mechanism is frequently used in modern websites to provide the users a list of suggestion while typing the beginning word in the text box. It facilitates the user to select an item from the list, which will be displayed in the input field.
ui-autocomplete : The menu used to display matches to the user. ui-autocomplete-input : The input element that the autocomplete widget was instantiated with.
Syntax: $("TagId"). autocomplete({ source : itemList // List of Words. })
You can use HTML5 'list' attribute in your input textbox and provide it a custom list of values by using datalist.
<!DOCTYPE html> <html> <head> <!--your stuff--> </head> <body> <!--your stuff--> <input type="text" id="txtAutoComplete" list="languageList"/><!--your input textbox--> <datalist id="languageList"> <option value="HTML" /> <option value="CSS" /> <option value="JavaScript" /> <option value="SQL" /> <option value="PHP" /> <option value="jQuery" /> <option value="Bootstrap" /> <option value="Angular" /> <option value="ASP.NET" /> <option value="XML" /> </datalist> </body> </html>
If you didn't get it, Read more at http://www.cheezycode.com/2015/09/create-auto-complete-dropdown-using.html
There's a video as well for it Auto-Complete Without JQuery
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With