Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

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?
0
sormafre
Asked:
sormafre
  • 6
  • 6
1 Solution
 
stefriCommented:
If ASP page, you will create on the fly the dropdown incrementing today's date by one day using dattadd function:
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>"
0
 
hhammashCommented:
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%>"><%=tmrDate%></option>
  <%
  Next
  %>
  </select></p>

Regards
hhammash
0
 
sormafreAuthor Commented:
hi,
thx for ur replies, but I am very useless :-(
I copied the code into frontpage, but it doesnt seem to work...
0
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

 
hhammashCommented:
Hi,

Copy the code first to NotePad,  then from NotePad copy it to Frontpage ans save your page as .asp.

It will work
hhammash
0
 
sormafreAuthor Commented:
Hey,
wow...that was a quick reply. I have tried that. but all I get is an empty drop-down box.
0
 
hhammashCommented:
Hi,

Can you please post your code?

hhammash
0
 
sormafreAuthor Commented:
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%>"><%=tmrDate%></option>
<%
Next
%>
</select></p>

</body>

</html>
0
 
hhammashCommented:
Hi,

Did you save your page as ASP?
Go to File/Save as and save the page as DateDrop.asp not .htm or .html.

Here is the sample with the same code I gave you.

http://www.fmhs.uaeu.ac.ae/immconf/DatePlus.asp

Regards
hhammash
0
 
sormafreAuthor Commented:
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%>"><%=tmrDate%></option>
<%
Next
%>
</select></p>

</body>

</html>
0
 
sormafreAuthor Commented:
Thx,
perfect...I had an .htm and an .asp version, and I used the wrong one. very happy now :-)

laters,
SorMaFre
0
 
hhammashCommented:
Hi,

Glad it worked

hhammash
0
 
sormafreAuthor Commented:
i dont know how u handle that points system here. Did u get them point?
0
 
hhammashCommented:
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
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now