Hi. I am pretty new to JavaScript and am having some difficulties. The project I’m working on incorporates code that was written by our client. The piece I’m having a problem with pre-populates a Select box on an ASP page with a list of months.
In some instances, one of the months in the select box will need to be pre-selected. This is where the problem lies. I cannot figure out how to get the Select box to pre-select anything. Here is the code I have been trying:
[i][b]
<!–
//this is the function that pre-populates the combo
document.write(populateMonths());
//this is where I’m trying to pre-select a specific value
document.frmClaimantDrug.lstEmpBeginM.SelectedIndex = “<%=intMonth%>”
//I have also tried:
document.frmClaimantDrug.lstEmpBeginM.Value = “<%strMonth%>”
// –>
The value for [b]intMonth