fuadhamidov
Programmer
Hi
i am new in js. i have tried and found some code to add an option to 'select' field. then i 'developed' it to add two option to two different select tag but i failed. the code i used is that
var option = document.form.TETS.value;
document.form.SIZE.options[document.form.SIZE.options.length] = new Option( option );
document.form.SIZE.options[document.form.SIZE.options.length - 1].value=document.form.NUMBER.value; document.form.SIZE.options[document.form.SIZE.options.length - 1].selected = true;
// *********** part2
document.form.SIZE2.options[document.form.SIZE2.options.length] = new Option( option );
document.form.SIZE2.options[document.form.SIZE2.options.length - 1].value=document.form.NUMBER.value; document.form.SIZE2.options[document.form.SIZE2.options.length - 1].selected = true;
the code work until 'part2' but second option does not occur
i am new in js. i have tried and found some code to add an option to 'select' field. then i 'developed' it to add two option to two different select tag but i failed. the code i used is that
var option = document.form.TETS.value;
document.form.SIZE.options[document.form.SIZE.options.length] = new Option( option );
document.form.SIZE.options[document.form.SIZE.options.length - 1].value=document.form.NUMBER.value; document.form.SIZE.options[document.form.SIZE.options.length - 1].selected = true;
// *********** part2
document.form.SIZE2.options[document.form.SIZE2.options.length] = new Option( option );
document.form.SIZE2.options[document.form.SIZE2.options.length - 1].value=document.form.NUMBER.value; document.form.SIZE2.options[document.form.SIZE2.options.length - 1].selected = true;
the code work until 'part2' but second option does not occur