(Re Post) i had going through this tutarial : PHP ajax database : how to pass two variables and get data of them in different div even one? ,but it seems not working,and i need to have 3 select works together.i choose first select option then using ajax to pass data for getting second and using the
function showUser(strOther);
to get third data which is related to the first and second answer.all is running well but the third select which is:
<select id="txtHint1">
doesnt show me any answer.here is my scripts:
<script>
function showForum(str) {
if (str=="") {
document.getElementById("txtHint").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("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getuser.php?q="+str,true);
xmlhttp.send();
}
</script>
<script>
function showUser(strOther) {
if(strOther==""){
document.getElementById("txtHint1").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("txtHint1").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getuser.php?q1="+strOther,true);
xmlhttp.send();
}
</script>
this is the select options which i get the ajax data:
<!-- this forum will be
choosed to pass data to get second
select to filled up-->
<form>
<!-- first select-->
<select name="users" onchange="showForum(this.value)">
<option value="">All Orgs</option>
<option value="1">WebStatsProject</option>
<option value="2">mmu</option>
</select>
</form>
this select option will be filled by the first ajax request: All Forums the third not show any data,the other two working properly:
<!-- third select-->
<select id="txtHint1">
<option value="All Users">All Users</option>
</select>