Kor
07-16-2003, 03:46 PM
function bla(){
var s = new Array(12)
for(i=0;i<=11;i++){
s[i] = "s"+i;
}
var sel = new Array(12)
for(i=0;i<=11;i++){
sel[i] = document.forms[0].s[i].selectedIndex;
}
alert(s[7]);
alert(sel[7]);
}
i can see s[7] value, but not the sel[7]...
i have 12 <select> in page, named "s0", "s1", "s2"....."s11". I want to use the selectedIndex values for further operation... But I want to make it in short way, using arrays... It seems I can not substitute s1, s2, ... names with s[i]....
var s = new Array(12)
for(i=0;i<=11;i++){
s[i] = "s"+i;
}
var sel = new Array(12)
for(i=0;i<=11;i++){
sel[i] = document.forms[0].s[i].selectedIndex;
}
alert(s[7]);
alert(sel[7]);
}
i can see s[7] value, but not the sel[7]...
i have 12 <select> in page, named "s0", "s1", "s2"....."s11". I want to use the selectedIndex values for further operation... But I want to make it in short way, using arrays... It seems I can not substitute s1, s2, ... names with s[i]....