Welcome Guest, Not a member yet? Register   Sign In
AJAX search using dropdown troubles
#2

[eluser]CI_Newb[/eluser]
Did more looking and think this is how it should look, but yet, not working.

Code:
function showUser(str)
{
var xmlhttp;
if (str=="")
  {
  document.getElementById('txtHint')[removed]="";
  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('txtHint')[removed]=xmlhttp.responseText;
    }
  }
xmlhttp.open("POST","http://mysite.com/site/assets/includes/get_template.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(str);
}

Changed the get_template to
Code:
$q = $_POST["str"];

Any ideas?


Messages In This Thread
AJAX search using dropdown troubles - by El Forum - 04-13-2011, 08:10 PM
AJAX search using dropdown troubles - by El Forum - 04-13-2011, 10:09 PM
AJAX search using dropdown troubles - by El Forum - 04-13-2011, 10:37 PM
AJAX search using dropdown troubles - by El Forum - 04-13-2011, 11:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB