Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make a Auto Complete Text Input like a list, it similar or the same as form post status of facebook in below picture, I known it can make by ajax and jQurey, so who know link demo, link guide, or example to make it, may be share for me to make reference, thank for help.
Here is example picture
http://i1095.photobucket.com/albums/i472/OLAKEN91/as_zpsd4476364.png
Posted

You should try out jQuery UI's Autocomplete[^] box. If you go to that website, you will find the basic working of Autocomplete and how you can implement it in your website.

You can use this code to create the autocomplete feature for an input element. Like this,

JavaScript
var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
];

$( "#tags" ).autocomplete({
   source: availableTags
});


This was a hardcoded string of available tags, you can somehow call to get the dynamic data from database or some other source. Then use them inside this variable from where the autocomplete would tag the items. You can use Ajax to get the data too.

CSS styling can be applied to the HTML for a different design. A test is present on their website, check it own there.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Nov-14 11:53am    
This is a good way to do such things, a 5.
—SA
Afzaal Ahmad Zeeshan 20-Nov-14 11:55am    
Thanks Sergey. :-)
Oh this code you find in http://jqueryui.com/autocomplete but thank for help
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900