sormafre
asked on
Populate drop-down box
I am using MS FrontPage and I would like to populate a drop-down box with the dates of 30 days starting toworrow.
Example:
(today is 3/2/2003)
the drop-down box should contain:
4/2/2003
5/2/2003
6/2/2003
7/2/2003
...and so on for 30 days.
Could anyone help me in this matter please?
Example:
(today is 3/2/2003)
the drop-down box should contain:
4/2/2003
5/2/2003
6/2/2003
7/2/2003
...and so on for 30 days.
Could anyone help me in this matter please?
Hi,
You can use this code: (it is 100% working)
<select size="1" name="MyDate">
<%
Dim idate
idate=date()
for i=1 to 30
tmrDate=idate+i
%>
<option value="<%=tmrDate%>"><%=tm rDate%></o ption>
<%
Next
%>
</select></p>
Regards
hhammash
You can use this code: (it is 100% working)
<select size="1" name="MyDate">
<%
Dim idate
idate=date()
for i=1 to 30
tmrDate=idate+i
%>
<option value="<%=tmrDate%>"><%=tm
<%
Next
%>
</select></p>
Regards
hhammash
ASKER
hi,
thx for ur replies, but I am very useless :-(
I copied the code into frontpage, but it doesnt seem to work...
thx for ur replies, but I am very useless :-(
I copied the code into frontpage, but it doesnt seem to work...
Hi,
Copy the code first to NotePad, then from NotePad copy it to Frontpage ans save your page as .asp.
It will work
hhammash
Copy the code first to NotePad, then from NotePad copy it to Frontpage ans save your page as .asp.
It will work
hhammash
ASKER
Hey,
wow...that was a quick reply. I have tried that. but all I get is an empty drop-down box.
wow...that was a quick reply. I have tried that. but all I get is an empty drop-down box.
Hi,
Can you please post your code?
hhammash
Can you please post your code?
hhammash
ASKER
Here u go:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor. Document">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="tlb, default">
</head>
<body>
<select size="1" name="MyDate">
<%
Dim idate
idate=date()
for i=1 to 30
tmrDate=idate+i
%>
<option value="<%=tmrDate%>"><%=tm rDate%></o ption>
<%
Next
%>
</select></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="tlb, default">
</head>
<body>
<select size="1" name="MyDate">
<%
Dim idate
idate=date()
for i=1 to 30
tmrDate=idate+i
%>
<option value="<%=tmrDate%>"><%=tm
<%
Next
%>
</select></p>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here u go:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor. Document">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="tlb, default">
</head>
<body>
<select size="1" name="MyDate">
<%
Dim idate
idate=date()
for i=1 to 30
tmrDate=idate+i
%>
<option value="<%=tmrDate%>"><%=tm rDate%></o ption>
<%
Next
%>
</select></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="tlb, default">
</head>
<body>
<select size="1" name="MyDate">
<%
Dim idate
idate=date()
for i=1 to 30
tmrDate=idate+i
%>
<option value="<%=tmrDate%>"><%=tm
<%
Next
%>
</select></p>
</body>
</html>
ASKER
Thx,
perfect...I had an .htm and an .asp version, and I used the wrong one. very happy now :-)
laters,
SorMaFre
perfect...I had an .htm and an .asp version, and I used the wrong one. very happy now :-)
laters,
SorMaFre
Hi,
Glad it worked
hhammash
Glad it worked
hhammash
ASKER
i dont know how u handle that points system here. Did u get them point?
Hi,
Next to my answer with the code you will see a "Accept this answer" then you will get a field with the points you designated. After that select the level A to C A is the highest. A or B or C each has different value.
You will still give away the same points, but your selection of A or B or C will decide what should I receive.
Thanks a lot
hhammash
Next to my answer with the code you will see a "Accept this answer" then you will get a field with the points you designated. After that select the level A to C A is the highest. A or B or C each has different value.
You will still give away the same points, but your selection of A or B or C will decide what should I receive.
Thanks a lot
hhammash
Get current day
Loop to 30, adding days to current day usind dateadd
today = date()
response.write "<select size='1' name='theDate'>"
for i = 1 TO 30
response.write "<option>" & dateadd("d",i,today)& "</option>"
next
response.write "</select>"