As you say you wanted to select multipls values be default while populating the SELECT box.
Do you have those 5/6 selectable data values prior to pulling data from DATABASE?
If so, assuming it to be in an array. While populating from the database, you would be running through a while loop untill EOF of RECORDSET, within that loop put a FOR loop based on LBOUND to UBOUND of the ARRAY that has values to be selected by default and set the <option> tags SELECTED attribute when the CURRENT record value is EQUAL to the CURRENT subset of the ARRAY.
I can give you a PSEUDOCODE/algorithm here.
<Select> tag...
<%
While NOT RS.EOF
sFlag=""
For i=Lbound(ARR) to Ubound(ARR)
If LCASE(ARR(i))=LCASE(RS("DATAFIELD")) then
sFalg="Selected"
BREAK THE LOOP HERE
End If
Next
Response.write "<option ....Value='" & RS("DATAFIELD") & "' " & sFlag & ">" & RS("DATAFIELD") & "</Option>"
RS.movenext()
Wend
%>
</Select> End Tag...
Something like this should do the trick for you.
Hope that helps.
Cheers!
-Vijay G
|