D
D
Denis Kostousov2010-12-27 23:09:28
JavaScript
Denis Kostousov, 2010-12-27 23:09:28

Live search when typing a query on a page?

It is necessary to implement a search for tags on the page when typing like Khabrovsky or Google: we start typing, after 2-3 characters a list of suitable options falls out. On it you can run the cursor using the keyboard or poke the mouse. Tags are entered separated by a separator (comma).

On the page I decided to use mootools. I myself have already written 3 lines in js (this is my first js code in my life).
We need an option when the entire list of tags is loaded when the page is loaded (when it is small) and when a json request is sent to the server when typing. There is no ready-made solution in mootools itself. Do you advise something? I don't want to reinvent the wheel. Yes, and it's long. At least what is this functionality properly called?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
N
niko83, 2010-12-27
@niko83

the function is called autocomplete

S
SEObomj, 2010-12-27
@SEObomj

www.web2ajax.fr/examples/facebook_searchengine/

R
reality, 2010-12-28
@reality

For mootools I use davidwalsh.name/mootools-jquery-textbox-list. Of course, it is not quite auto-compote in the classical sense, but with minimal work with a file, it turns into it

K
Kakysha, 2010-12-29
@kakysha

Recently I jumped like a “startup” habrahabr.ru/blogs/startup/110509/
Maybe it will be useful to you, since you are talking with JS for the first time.

I
igrishaev, 2010-12-29
@igrishaev

Drupal comes with a jQuery autocomplete plugin, I think you should check it out.

A
Alexey Ashurok, 2010-12-29
@AotD

This great thing comes out of the jQuery UI box: jqueryui.com/demos/autocomplete/#remote-with-cache
Autocomplete with a predefined list, with JSON loading, with caching, with an example for tags separated by commas. I have enough. The only negative for you is not mootols =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question