biddingbong
IS-IT--Management
Hi, Ive got a combo listing numbers from 1 to 31. And when saving, the number selected will be saved in the database.
But I want the number that has been saved to be <selected> in the combo next time the page is launched.
I did that:
<%
Dim strDate
strDate = Request.Form("cboDate") 'cboDate is the combo
%>
<select name="cboDate" class="Combo">
<%
If Len(strDate)=0 Then
strDate="Date"
End If
%>
<option selected><%=strDate%></option>
<% For i=1 to 31 %>
<%Response.write "<option>" & i & "</option>"%>
<% Next %>
</select><font color="#FF0000"><sup>*</sup></font>
But the problem is that when a number has been saved,the combo will select that number but still, it will list all the numbers from 1 to 31, including the selected number.
Is there a way to remove that repetition.
Thanks.
But I want the number that has been saved to be <selected> in the combo next time the page is launched.
I did that:
<%
Dim strDate
strDate = Request.Form("cboDate") 'cboDate is the combo
%>
<select name="cboDate" class="Combo">
<%
If Len(strDate)=0 Then
strDate="Date"
End If
%>
<option selected><%=strDate%></option>
<% For i=1 to 31 %>
<%Response.write "<option>" & i & "</option>"%>
<% Next %>
</select><font color="#FF0000"><sup>*</sup></font>
But the problem is that when a number has been saved,the combo will select that number but still, it will list all the numbers from 1 to 31, including the selected number.
Is there a way to remove that repetition.
Thanks.