470,810 Members | 880 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

Fill text box on form with specific date ?

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
Jul 21 '05 #1
4 1667
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?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 21 '05 #2
David wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 21 '05 #3
Bob Barrows [MVP] wrote:
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.
Jul 21 '05 #4
Dave Anderson wrote:
Bob Barrows [MVP] wrote:
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!


:-)
handled it in the code even though I didn't express it in my assumption.

Bob
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Sheela | last post: by
5 posts views Thread by Art | last post: by
8 posts views Thread by netsurfer | last post: by
6 posts views Thread by MROPARTNER | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.