0

Their search fields can type and have some kind of list is showing here.... For example, when I type "Wikipedia" , when I start type "W", it have "Wi", "Wii", "Will" , somethings like that... ...How to do something similar like this? Thank you.

Kappa
  • 1,015
  • 1
  • 16
  • 31
Tattat
  • 15,548
  • 33
  • 87
  • 138

3 Answers3

1

Several javascript libraries provide this functionality. For example with jQuery, you can use the Autocomplete pulgin. The link also includes a demo.

odrm
  • 5,149
  • 1
  • 18
  • 13
1

Depending on how you are planning on using the auto complete there is a jquery plugin that can help with this feature.

Essentially you are capturing the data as a user types and are checking against an array of some type to see similar matches. Your array can be statically set or be dynamic using ajax to query a script which returns data that is similar.

See: http://code.drewwilson.com/entry/autosuggest-jquery-plugin

Ryan Matthews
  • 1,043
  • 9
  • 28
0

the jQuery liveSearch plugin will do this. Here is the plugin site with pretty detailed instructions for connection to a php search page: http://andreaslagerkvist.com/jquery/live-search/

Steve Kelly
  • 371
  • 3
  • 17