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 .. ???
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 .. ???