Hi
I want to use javascript to read form's listbox index in a for loop boundry.
The problem is shown below:
<select name="List2" value = "<please select an occupation>" onChange="this.form.ValueIn2.value=this.options[this.selectedIndex].value">
"<please selecrt an occupation>" <option>
<script type="text/javascript">
/////////INSTEAD OF 6 I WOULD LIKE TO READ A LISTBOX
///////// SELECTEDINDEX NUMBER
///////// FROM ANOTHER SELECTBOX WITHIN THE SAME FORM
///////// WHAT SHOULD I TYPE IN CONSIDERING THE FACT
//////// THAT I AM IN JAVASCEIPT. I TRIED to put
//////// form1.List1.options[selectedIndex] and also
//////// documen.write('form1.List1.options[selectedIndex]
//////// but none of them worked
for (loop7=0;loop7 < 6 ;loop7++){
document.write('<option>');
}
</script>
</select>
</form>
I want to use javascript to read form's listbox index in a for loop boundry.
The problem is shown below:
<select name="List2" value = "<please select an occupation>" onChange="this.form.ValueIn2.value=this.options[this.selectedIndex].value">
"<please selecrt an occupation>" <option>
<script type="text/javascript">
/////////INSTEAD OF 6 I WOULD LIKE TO READ A LISTBOX
///////// SELECTEDINDEX NUMBER
///////// FROM ANOTHER SELECTBOX WITHIN THE SAME FORM
///////// WHAT SHOULD I TYPE IN CONSIDERING THE FACT
//////// THAT I AM IN JAVASCEIPT. I TRIED to put
//////// form1.List1.options[selectedIndex] and also
//////// documen.write('form1.List1.options[selectedIndex]
//////// but none of them worked
for (loop7=0;loop7 < 6 ;loop7++){
document.write('<option>');
}
</script>
</select>
</form>