<script>
function showExpHint(s)
{
if (s.length==0)
{
document.getElementById("txtExmpHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtExmpHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","gethint.php?q="+s,true);
xmlhttp.send();
}
</script>
----------------------------------
<form>
First name: <input type="text" onkeyup="showExmpHint(this.value)">
</form>
<p>Suggestions: <span id="txtExmpHint"></span></p>
function showExpHint(s)
{
if (s.length==0)
{
document.getElementById("txtExmpHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtExmpHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","gethint.php?q="+s,true);
xmlhttp.send();
}
</script>
----------------------------------
<form>
First name: <input type="text" onkeyup="showExmpHint(this.value)">
</form>
<p>Suggestions: <span id="txtExmpHint"></span></p>
No comments:
Post a Comment