tek707
07-18-2002, 01:18 AM
Hello everyone,
I'm trying to figure out or find some coding where you make a selection of a category in a drop down and if that category has subcategories a second drop down will automatically will fill it self with those subcategories but here's the kicker...these drop downs have to able to be "SELECTED" when the value matches from what I'm pulling from a record set as if I'm updating that data.
Simple non dynamic SELECTED example:
<% TodaysDate = Split(Date(),"/")%>
<select name = "Month" class="InputSelect" tabindex = "8">
<option value = "">Month</option>
<%For Counter = 1 to 12%>
<option value = "<%=Counter%>" <%If CInt(TodaysDate(0)) = Counter Then%>SELECTED<%End If%>><%DisplayMonth(Counter)%></option>
<%Next%>
</select>
<select name = "Day" class="InputSelect" tabindex = "9">
<option value = "">Day</option>
<%For Counter = 1 to 31%>
<option value = "<%=Counter%>" <%If CInt(TodaysDate(1)) = Counter Then%>SELECTED<%End If%>><%=Counter%></option>
<%Next%>
</select>
<%sDate = Split(Date(),"/")%>
<select name = "Year" tabindex = "10">
<option value = "">Year </option>
<%For Counter = 0 to 3%>
<option value = "<%=sDate(2) - Counter%>" <%If CInt(TodaysDate(2)) = sDate(2) - Counter Then%>SELECTED<%End If%>><%= sDate(2) - Counter%></option>
<%Next%>
</select>
I'm trying to figure out or find some coding where you make a selection of a category in a drop down and if that category has subcategories a second drop down will automatically will fill it self with those subcategories but here's the kicker...these drop downs have to able to be "SELECTED" when the value matches from what I'm pulling from a record set as if I'm updating that data.
Simple non dynamic SELECTED example:
<% TodaysDate = Split(Date(),"/")%>
<select name = "Month" class="InputSelect" tabindex = "8">
<option value = "">Month</option>
<%For Counter = 1 to 12%>
<option value = "<%=Counter%>" <%If CInt(TodaysDate(0)) = Counter Then%>SELECTED<%End If%>><%DisplayMonth(Counter)%></option>
<%Next%>
</select>
<select name = "Day" class="InputSelect" tabindex = "9">
<option value = "">Day</option>
<%For Counter = 1 to 31%>
<option value = "<%=Counter%>" <%If CInt(TodaysDate(1)) = Counter Then%>SELECTED<%End If%>><%=Counter%></option>
<%Next%>
</select>
<%sDate = Split(Date(),"/")%>
<select name = "Year" tabindex = "10">
<option value = "">Year </option>
<%For Counter = 0 to 3%>
<option value = "<%=sDate(2) - Counter%>" <%If CInt(TodaysDate(2)) = sDate(2) - Counter Then%>SELECTED<%End If%>><%= sDate(2) - Counter%></option>
<%Next%>
</select>