Trying to create a year/make/model multi change select, and while I do in fact have the scripts working, what seems to be missing is the ability to pass a year variable along with a make variable to get the final model results.
Here's my present ajax functions:
$(document).ready(function(){
$(".year").change(function(){
var year=$(this).val();
var dataString = 'year='+ year;
$.ajax({
type: "GET",
url: "ajax2.php",
data: dataString,
cache: false,
success: function(html){
$(".make").html(html);
}
});
});
$(".make").change(function(){
var make=$(this).val();
var dataString = 'make='+ make;
$.ajax({
type: "GET",
url: "ajax2.php",
data: dataString,
cache: false,
success: function(html){
$(".model").html(html);
}
});
});
});
My question is, how could I successfully pass the year variable as well as the make variable on the second ajax call so I can properly retrieve the model for that year and make?