I am trying to come up with a way using ajax and jquery to display a range of values for a select box. The first drop down has options that need to talk to a 2nd drop box and that is a range of numbers, I know how to set the value of a drop down to 1 value, but not how set the whole range. By default the dropdowns are being generated by php range function.
Any help would be appreciated.
Update This is not the most elegant, but here is what i have
$('.change').change(function(){
var options='';
var max = $('.change option:selected').attr('title');
var min = $('.change option:selected').attr('id');
for(i=min; i <= max; i++){
options+='<option value="'+i+'">'+i+'</option>';
}
$('select[name=ticket_qty]').find("option").remove();
$('select[name=ticket_qty]').append(options);
});
I am having trouble pulling the "ID" and "TITLE" for the selected option