I have 2 related drop down lists populated by AJAX. The problem is the 2nd one needs to be automatic after the first one is populated. AS it is right now the 2nd one sticks. The 2nd one doesn't have to be selected it just has to be displayed to the user after the first list populates. AS it stands now it shows the old list from the last search until you change the top one then it drops down with the right list but the user doesn't know what happened. It is held up because I'm using onChange to call it. So I just need to have it automatically drop down when the first one drops down at the same time. Right now there are two onChange() events called in both of the input tags. I just need the second one to drop down right after the first one does. I need some ideas, thanks.
function fillZoneNm() {
var bu = document.forms[0].search_bu.value;
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() {
document.getElementById("search_zonenm").innerHTML=xmlhttp.responseText;
}
xmlhttp.open("GET","get_bus.php?bu="+bu,true);
//xmlhttp.open("GET","get_bus.php?bu=" + bu,true);
xmlhttp.send();
}
function fillZoneId() {
var bu = document.forms[0].search_bu.value;
alert(bu);
var zonenm = document.forms[0].search_zonenm.value;
alert(zonenm)
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() {
document.getElementById("search_zoneid").innerHTML=xmlhttp.responseText;
}
xmlhttp.open("GET","get_zonenms.php?bu="+bu+"&zonenm="+zonenm,true);
xmlhttp.send();
}