Reply
Updating listbox with 2 RecordSets (ASP and SQL)
Old 09-27-2006, 11:46 PM Updating listbox with 2 RecordSets (ASP and SQL)
Junior Talker

Posts: 1
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>
superkid is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Reply     « Reply to Updating listbox with 2 RecordSets (ASP and SQL)
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.10493 seconds with 12 queries