select list autoselect a value

View: New views
1 Messages — Rating Filter:   Alert me  

select list autoselect a value

by Giri-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Is there an easy way for making an option selected (by default) in the select box?, I want to make the last option in the select list selected.

I am using the following code for populating the select box, in this example, how do I make 2005 as selected by default?

var strSYear = 1990;
var strEYear = 2005;

for(i=strSYear;i<=strEYear;i++)
 {
      DWRUtil.addOptions("syearList",[i]);    
 }

I would appreciate if you could provide any input on this.

Thanks in advance

Giri