Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Fill text box on form with specific date ?

Reply
Thread Tools

Fill text box on form with specific date ?

 
 
David
Guest
Posts: n/a
 
      11-02-2004
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
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      11-02-2004
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)

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      11-02-2004
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"


 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      11-03-2004
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.


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      11-03-2004
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
Fill Combo Box based on another Combo Box dthmtlgod ASP General 1 11-16-2005 04:08 PM
Want to fill a form box2 automatically based on form box1 input [on the same page] Matt MC HTML 2 05-25-2005 10:07 PM
Want to fill a form box2 automatically based on form box1 input [on the same page] Matt MC Javascript 2 05-25-2005 10:07 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57