Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
23
rated 0 times [  25] [ 2]  / answers: 1 / hits: 87432  / 13 Years ago, fri, august 26, 2011, 12:00:00

I am developing a web page which has a requirement of many autocomplete textboxes. As I am new to javascript, it is very tough for me to make my own autocomplete textbox. So I have searched many examples from the internet, but they only work for a single textbox. This means I cannot use the same js file to make another autocomplete textbox. I didn't find any such examples on stackoverflow either. Can someone help me in this?


More From » html

 Answers
46

Use JQuery with the AutoSuggest plugin.



http://docs.jquery.com/Plugins/autocomplete



Include the JS libraries (see the documentation above), then do this in HTML:



<input type=text class=autocomplete name=n1 />
<input type=text class=autocomplete name=n2 />
<input type=text class=autocomplete name=n3 />
<input type=text class=autocomplete name=n4 />


Then add an Autocomplete to the CSS-class in your Javascript:



var data = Core Selectors Attributes Traversing Manipulation CSS Events Effects Ajax Utilities.split( );
$(.autocomplete).autocomplete(data);

[#90403] Wednesday, August 24, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
josuea

Total Points: 609
Total Questions: 121
Total Answers: 104

Location: South Georgia
Member since Fri, Nov 13, 2020
4 Years ago
josuea questions
;