|
Hi I would like to create a DB driven listbox. one recordset is used to list all the countries into the list. the 2nd recordset is used to add the selected value. But I could only list all the countries into the box and not able to preselect the country. Below is my code and hope someone could highlight to me my mistake.
Thank You,
Mark
<select name="lstCountry">
<%
Do Until rstCountry.EOF
Set objCountry = rstCountry("CountryID")
%>
<option <% if rstCountry("CountryID") = RS("UserCountry") then response.write("selected")%> value = "<%=rstCountry("CountryID")%>">
<%=rstCountry("CountryName")%>
</option>
<%rstCountry.MoveNext%>
<% Loop%>
</select>
|