F
Feijó
I have several combobox (select) witch when a User choose a value in
the first combo, it triggers an Ajax to feed the second combo. When
the second combo got its values, another Ajax feed my third combo, and
so one.
Its about 5 combos.
Ajax is not syncronous, can't be
My ajax return a new <select> <option> set
Thanks for any tip!
Here is what I'm trying:
var ie = (/msie/i.test(navigator.userAgent));
var tempo = 150;
function SelectCombo1() {
if (debug) document.getElementById('debugnc').innerHTML = Date() + '
nc<br>';
// I need to disapear with my combo or the next function will not work
if (!ie) // ie sucks
document.form1.Combo1=undefined;
else if (typeof !document.form1.Combo1 == 'undefined')
document.form1.Combo1.destroy();
var param = (document.form1.Combo1.value);
loadXMLDoc('combo.php?ajax=1&cod='+param, 'combo1', 'lista');
setTimeout("SelectCombo2();", tempo);
}
function SelectCombo2() {
if (typeof document.form1.Combo1 == 'undefined')
// wait until Combo1 is done
setTimeout("SelectCombo();", tempo);
else {
if (!ie)
document.form1.Combo2=undefined;
else if (typeof !document.form1.Combo2 == 'undefined')
document.form1.Combo2.destroy();
loadXMLDoc(str, 'combo2, 'lista');
setTimeout("SelectCombo3();", tempo);
}
}
the first combo, it triggers an Ajax to feed the second combo. When
the second combo got its values, another Ajax feed my third combo, and
so one.
Its about 5 combos.
Ajax is not syncronous, can't be
My ajax return a new <select> <option> set
Thanks for any tip!
Here is what I'm trying:
var ie = (/msie/i.test(navigator.userAgent));
var tempo = 150;
function SelectCombo1() {
if (debug) document.getElementById('debugnc').innerHTML = Date() + '
nc<br>';
// I need to disapear with my combo or the next function will not work
if (!ie) // ie sucks
document.form1.Combo1=undefined;
else if (typeof !document.form1.Combo1 == 'undefined')
document.form1.Combo1.destroy();
var param = (document.form1.Combo1.value);
loadXMLDoc('combo.php?ajax=1&cod='+param, 'combo1', 'lista');
setTimeout("SelectCombo2();", tempo);
}
function SelectCombo2() {
if (typeof document.form1.Combo1 == 'undefined')
// wait until Combo1 is done
setTimeout("SelectCombo();", tempo);
else {
if (!ie)
document.form1.Combo2=undefined;
else if (typeof !document.form1.Combo2 == 'undefined')
document.form1.Combo2.destroy();
loadXMLDoc(str, 'combo2, 'lista');
setTimeout("SelectCombo3();", tempo);
}
}