Buscando encontre este, esta muy chulo asi que decidi entrarle :)
Código HTML:
Ver original<script type="text/javascript" src="js/bsn.AutoSuggest_2.1.3.js" charset="utf-8"></script> <link rel="stylesheet" href="css/autosuggest_inquisitor.css" type="text/css" media="screen" charset="utf-8" />
<h3>Ejemplo de autobusqueda
</h3>
<div><input type="hidden" id="testid" /> Person :
<input type="text" id="testinput_xml" value="" style="width:300px" />
<script type="text/javascript"> var options = {
script:"test.php?json=true&limit=6&",
varname:"input",
json:true,
shownoresults:false,
maxresults:6,
callback: function (obj) { document.getElementById('testid').value = obj.id; }
};
var as_json = new bsn.AutoSuggest('testinput', options);
var options_xml = {
script: function (input) { return "test.php?input="+input+"&testid="+document.getElementById('testid').value; },
varname:"input"
};
var as_xml = new bsn.AutoSuggest('testinput_xml', options_xml);
y el php esta asi
Código PHP:
Ver original<?php
"Ädams, Egbert",
"Altman, Alisha",
"Archibald, Janna",
"Auman, Cody",
"Bagley, Sheree",
"Ballou, Wilmot",
"Bard, Cassian",
"Bash, Latanya",
"Beail, May",
"Black, Lux",
"Bloise, India"
);
"Bedfordshire",
"Buckinghamshire",
"Cambridgeshire",
"Cheshire",
"Cornwall",
"Cumbria",
"Derbyshire",
"Devon",
"Dorset",
"Durham"
);
$limit = isset($_GET['limit']) ?
(int
) $_GET['limit'] : 0;
$count = 0;
if ($len) {
for ($i=0;$i<count($aUsers);$i++) { $count++;
}
if ($limit && $count==$limit)
break;
}
}
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0
if (isset($_REQUEST['json'])) {
} else {
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?><results>";
for ($i=0;$i<count($aResults);$i++) {
echo "<rs id=\"".$aResults[$i]['id']."\" info=\"".$aResults[$i]['info']."\">".$aResults[$i]['value']."</rs>";
}
echo "</results>";
}
?>
que tengo que editar para sustituir esos array por una busqueda en mi bace de datos