Fill text box on form with specific date ?

D

David

Hi,

Quick question:

Using ASP, If I have a text box on a form, how can I auto populate it
when the form loads with the date of the current Friday, i.e.
dd/mm/yyyy


Thanks for your help



David
 
E

Evertjan.

David wrote on 02 nov 2004 in microsoft.public.inetserver.asp.general:
the date of the current Friday

First you have to define "current".

is that "next" or "last" Friday?
 
B

Bob Barrows [MVP]

David said:
Hi,

Quick question:

Using ASP, If I have a text box on a form, how can I auto populate it
when the form loads with the date of the current Friday, i.e.
dd/mm/yyyy

What do you consider to be the current Friday? 2004-10-29? Or 2004-11-5?
I will assume it to be the first Friday to follow the current date.

<%
dim today,curFri
curFri=date()
do until weekday(curFri) = vbFriday
curFri= dateadd("d",1,curFri)
loop
curFri = left("0" & day(curFri),2) & "/" & left("0" & month(curFri),2) & _
"/" & year(curFri)
%>
<input value="<%=curFri%>">

Bob Barrows
 
D

Dave Anderson

Bob said:
What do you consider to be the current Friday? 2004-10-29? Or
2004-11-5? I will assume it to be the first Friday to follow the
current date.

Certainly not if the current day is a Friday!



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top