tiamat2012
Programmer
Hey all,
I was wondering if there were any way to loop through selects? It looks really sloppy to write out 12 different assignments, here's my code:
I would like to do a loop through the pic1, pic2, etc. (which are <selects>)
anyone know how I could do that?
something like document.MyForm.select wouldn't work because I have many more selects than just these on the page, unless I were to find which number select it was.
Thank you,
-Kerry
I was wondering if there were any way to loop through selects? It looks really sloppy to write out 12 different assignments, here's my code:
Code:
document.MyForm.pic1.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic2.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic3.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic4.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic5.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic6.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic7.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic8.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic9.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic10.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic11.options[i] = new Option(picarray[i], picarray[i]);
document.MyForm.pic12.options[i] = new Option(picarray[i], picarray[i]);
I would like to do a loop through the pic1, pic2, etc. (which are <selects>)
anyone know how I could do that?
something like document.MyForm.select wouldn't work because I have many more selects than just these on the page, unless I were to find which number select it was.
Thank you,
-Kerry