Hi
I have a small form which allows the user to make a selection from two drop down menus.
What I need to do is update 6 div contents.
Each div shows the number of relevant rows in the database which match the users selections from the form.
I can work out how to update 1 div based on the script below but I don’t know how to update several divs.
Can someone please help me with this as its the last part I need to get working on this page.
function showBigTotals(){
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('startResults');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
var big_make = document.getElementById('big_make').value;
var big_model = document.getElementById('big_model').value;
var big_min_price = document.getElementById('big_min_price').value;
var big_max_price = document.getElementById('big_max_price').value;
if (document.getElementById("big_pics").checked==true) {
var photos = "Yes";
}
else {
var photos = "No";
}
var queryString = "?big_make=" + big_make + "&big_model=" + big_model + "&big_min_price=" + big_min_price + "&big_max_price=" + big_max_price + "&photos=" + photos;
ajaxRequest.open("GET", "count.php" + queryString, true);
ajaxRequest.send(null);
}