Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use Autocomplete without JQuery UI

Is there a way to use autocomplete without JQuery UI cause JQuery UI's footprint is too large (including its CSS) ?

or is there any alternative plugin or something, I googled this a lot but didn't find any.

like image 357
Shehabic Avatar asked Oct 22 '25 07:10

Shehabic


2 Answers

You can build your own that does not depend on JQuery UI, its a very simple idea of trigger field onchange(), issue an AJAX call to get result that matches what you typed so far, and populate some field with a div or drop down below or near it. And on select of the div or drop down, you populate your trigger field with selected value.

I know that Jquery Autosuggest does not use JQuery UI but does require JQuery.

like image 120
Churk Avatar answered Oct 23 '25 20:10

Churk


Refer below snippet for autocomplete without using jQuery. This is plain html5 with datalist tag works on all modern browsers.

<!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 need help related to implement this, refer this link

like image 20
Cheezy Code Avatar answered Oct 23 '25 21:10

Cheezy Code



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!