?
Solved

Populate drop-down box

Posted on 2003-03-02
13
Medium Priority
?
201 Views
Last Modified: 2013-12-24
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
Comment
Question by:sormafre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
13 Comments
 
LVL 13

Expert Comment

by:stefri
ID: 8052271
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
 
LVL 14

Expert Comment

by:hhammash
ID: 8052820
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
 

Author Comment

by:sormafre
ID: 8053261
hi,
thx for ur replies, but I am very useless :-(
I copied the code into frontpage, but it doesnt seem to work...
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 14

Expert Comment

by:hhammash
ID: 8053272
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
 

Author Comment

by:sormafre
ID: 8053300
Hey,
wow...that was a quick reply. I have tried that. but all I get is an empty drop-down box.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8053308
Hi,

Can you please post your code?

hhammash
0
 

Author Comment

by:sormafre
ID: 8053321
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
 
LVL 14

Accepted Solution

by:
hhammash earned 300 total points
ID: 8053350
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
 

Author Comment

by:sormafre
ID: 8053352
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
 

Author Comment

by:sormafre
ID: 8053391
Thx,
perfect...I had an .htm and an .asp version, and I used the wrong one. very happy now :-)

laters,
SorMaFre
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8053400
Hi,

Glad it worked

hhammash
0
 

Author Comment

by:sormafre
ID: 8053409
i dont know how u handle that points system here. Did u get them point?
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8053432
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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question