...

View Full Version : change drop-down menu values



crmpicco
03-22-2005, 04:26 PM
I have this text box:



<input type="text" name="test2" id="test2">



With the value that is inserted into this textbox I want to change the values of two drop-down menus:

The first one is for the DAY:




<Select style="height: 20; font-size : 10;" Name="depDay" onchange="javascript: sortMn('OUT')">
<%
dy = (DatePart("d", date()) + 7)
' response.Write "dy="&dy&"<br>"
nxtMn = False
if dy > 31 then
dy = (dy - 31)
nxtMn = True
end if
for i=1 to 31
%>
<% if i=dy then %>
<option value="<%=i%>" SELECTED><%=i%></option>
<% else %>
<option value="<%=i%>"><%=i%></option>
<% end if
next %>
</Select>



the second one is for the MONTH:



<Select style="width: 110; height: 20; font-size : 10;" Name="depMonth" onchange="javascript: sortMn('OUT')">
<%
mnNow = Month(Now)
yr = Year(Now)
nxtYr = left(yr, 2) & "0" & (right(yr, 2) + 1)
if nxtMn then
mnNow = (mnNow + 1)
end if
for i=mnNow to (mnNow + 11)
ic = i
nextYr = False
if i > 12 then
ic = (i - 12)
nextYr = True
end if
mn = MonthName(ic)
%>
<% if i=mnNow then %>
<option value="<%=yr & "#" & ic%>" SELECTED><%=mn & " " & yr%></option>
<% else %>
<option value="<% if nextYr then response.write nxtYr else response.write yr %>#<%=ic%>">
<%=mn & " "%><% if nextYr then response.write nxtYr else response.write yr %></option>
<% end if
next %>
</Select>

crmpicco
03-22-2005, 05:22 PM
the value of the text box is in format: MM/DD/YYYY

The two drop-dopwn menus are day and month

crmpicco
03-22-2005, 05:22 PM
is there a way i can cut the value up and match it against the values in the drop down menus?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum