I need one where I can edit the words myself, because I dont need a huge dictionary of words. Ive tried this guys but cant seem to get it to work. http://www.beauscott.com/examples/autocomplete/ The site I want to use it on is this one. http://www.plentyoftorrents.com Any suggestions would be appreciated.
xyz.htm <html> <head> <script src="suggest.js"></script> </head> <body> <form> First Name: <input type="text" onkeyup="suggest(this.value)"> </form> <div id="suggestions"></div> </body> </html> HTML: suggest.js var xmlHttp function suggest(string) { if (string.length==0) { document.getElementById("suggestions").innerHTML=" "; return; } xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("NO ajax support"); return; } var url="suggest.php"; url=url+"?word="+string; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); document.getElementById("suggestions").innerHTML='generating..'; } function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById("suggestions").innerHTML=xmlHttp.responseText; } } function GetXmlHttpObject() { var xmlHttp=null; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } Code (markup): suggest.php $sql = mysql_query("select * from abc where words like '".$_get['word']."'); while($q=mysql_fetch_array($sql)) { echo $q['word']; echo ("<br />"); } PHP: Just an attempt dunno how google displays them in input field itself
script.aculo.us has a nice auto complete future -> http://demo.script.aculo.us/ajax/autocompleter Dojo also provides auto complete text box control.
Thanks I'll check it out. I just want to make suggestions for the most common searches in my search form. Like if someone types prison break, the latest episodes will come up. "Prison Break S03E12" Which gets the best search results.