Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Countries List Selection

Status
Not open for further replies.

JKingdom

Programmer
May 9, 2004
141
AE
hi ..

i have a countries drop down list ...


<option>Afganistan</option>
<option>Albania</option>
<option>Algeria</option>
<option>American Samoa</option>
<option>Andorra</option>

.
.
.
.

i have to pages one to insert a new record and what to edit it .. i have no problems with adding .. but when editing the fields should have the current values of my record .. all what i want to know is how to select the same country as the one in the database form the drop down list ..

i know how ro do it if the countries were stored in the databse ..
//////////
<%
rsCountry.open "select * from countries",con,2,3

do while not rs.EOF
if rsCountry("name") = rsEmp("country") then
%>
<option selected><%=rsCountry("name")></option>

<%else%>

<option ><%=rsCountry("name")%></option>
<%
end if
rs.movenext
loop
%>

////////////

but what if i have them in the page itself not from the database .. ???
 
opps .. so many typos and spelling mistakes in there .. let me know if u didn't get it ...
 
how about using sessions variables...something like...

if Session("name") = rsEmp("country") then

-DNG

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top