Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Why don't you use jQuery + jQuery UI feature called "Autocomplete" with ajax datasource?</p> <p>Here's an example...</p> <p><strong>html:</strong></p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;title&gt;jQuery UI Autocomplete - Remote datasource&lt;/title&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt; &lt;style&gt; .ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } &lt;/style&gt; &lt;script&gt; $(function() { function log( message ) { $( "&lt;div&gt;" ).text( message ).prependTo( "#log" ); $( "#log" ).scrollTop( 0 ); } $( "#birds" ).autocomplete({ source: "search.php", minLength: 2, select: function( event, ui ) { log( ui.item ? "Selected: " + ui.item.value + " aka " + ui.item.id : "Nothing selected, input was " + this.value ); } }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="ui-widget"&gt; &lt;label for="birds"&gt;Birds: &lt;/label&gt; &lt;input id="birds" /&gt; &lt;/div&gt; &lt;div class="ui-widget" style="margin-top: 2em; font-family: Arial;"&gt; Result: &lt;div id="log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>As for the data source (search.php for e.g.): <a href="http://api.jqueryui.com/autocomplete/#option-source" rel="nofollow">http://api.jqueryui.com/autocomplete/#option-source</a></p> <p>Full demo / documentation / samples : <a href="http://jqueryui.com/autocomplete/#remote" rel="nofollow">http://jqueryui.com/autocomplete/#remote</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload