This is the code I have to display a drop down box with values from 1 to 100
<select name="reports">
<option selected value="1">1</option>
<% for i = 2 to 100 %>
<option value="<%=i%>"><%=i%></option>
<% next
i = i + 1
%>
Suppose I insert (value=45) for reports into a database. The next time I view this drop down box for that particular report....I want 45 to be selected (highlighted) instead of 1 (which is the default)
I tried doing this:
------------------
<select name="reports">
<% for i = 1 to 100 %>
If Session("val" = i then
<option selected value="<%=Session("val"%>"><%
=Session("val"%></option>
<% Else %>
<option value="<%=i%>"><%=i%></option>
<% End If
next
i = i + 1
%>
Can somebody help me with this problem??
<select name="reports">
<option selected value="1">1</option>
<% for i = 2 to 100 %>
<option value="<%=i%>"><%=i%></option>
<% next
i = i + 1
%>
Suppose I insert (value=45) for reports into a database. The next time I view this drop down box for that particular report....I want 45 to be selected (highlighted) instead of 1 (which is the default)
I tried doing this:
------------------
<select name="reports">
<% for i = 1 to 100 %>
If Session("val" = i then
<option selected value="<%=Session("val"%>"><%
=Session("val"%></option>
<% Else %>
<option value="<%=i%>"><%=i%></option>
<% End If
next
i = i + 1
%>
Can somebody help me with this problem??