Hi all,
My code loops through an array, assigning each value as an option to one select list. I always want "Choose time: " to appear in the select list, so before I enter the loop, I start with that option (index of 0).
From there, I start adding options to the select list:
var = new Option(value,index);
Is there a way in my code that I could ensure that any one of the values I add in will be selected when the select list is finished drawing?
I looked up options.selected but that seems to be used for retrieving values. option.selectedIndex seems to be used only for retrieving value of selected Option.
Any help is greatly appreciated.
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
Cheers!
Laura
My code loops through an array, assigning each value as an option to one select list. I always want "Choose time: " to appear in the select list, so before I enter the loop, I start with that option (index of 0).
From there, I start adding options to the select list:
var = new Option(value,index);
Is there a way in my code that I could ensure that any one of the values I add in will be selected when the select list is finished drawing?
I looked up options.selected but that seems to be used for retrieving values. option.selectedIndex seems to be used only for retrieving value of selected Option.
Any help is greatly appreciated.
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
Cheers!
Laura