Note that there are some explanatory texts on larger screens.

plurals
  1. PODrew Wilson Auto Suggest Plugin not working
    text
    copied!<p>I have my index page INDEX.html and a PHP page TEST.php then an autosuggest javascript code.</p> <p>I am trying to make an auto suggest search field. </p> <p>I am not getting autosuggest output. </p> <p>Only <code>NO RESULT FOUND</code> is shown.</p> <p>Someone please help me to make autosuggest shown in <a href="http://code.drewwilson.com/entry/autosuggest-jquery-plugin" rel="nofollow">http://code.drewwilson.com/entry/autosuggest-jquery-plugin</a> work.</p> <pre><code>&lt;link href="css/autoSuggest.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="js/jquery-1.4.2.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="jquery.autoSuggest.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" name="form1" method="post" action=""&gt; &lt;label for="q"&gt;&lt;/label&gt; &lt;input style="width: 300px;" type="text" name="q" id="q" /&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("input[type=text]").autoSuggest("test.php",{minChars: 2, matchCase: false});}); &lt;/script&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and PHP looks like this:</p> <pre><code>&lt;?php include("script/core/dbcon.php"); $input = $_REQUEST['q']; $data = array(); // query your DataBase here looking for a match to $input $query = mysql_query("SELECT * FROM user WHERE username LIKE '%$input%'"); while ($row = mysql_fetch_assoc($query)) { $json = array(); $json['value'] = $row['id']; $json['name'] = $row['username']; $data[] = $json; } header("Content-type: application/json"); echo json_encode($data); ?&gt; </code></pre>
 

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