473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1747
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Sheela | last post by:
hi all, I'm searching all around the web without any good answer, maybe you have the right one. I'm trying to fill&send a form on a site authenticated https via curl. The problem is simply that...
5
by: Art | last post by:
Hi, I'm using a form text input to display a JavaScript clock. It has no other purpose than that, just show the date and time. What I would like to do now is prevent anything else happening when...
8
by: netsurfer | last post by:
Hi: Have a question on making the date automatically filled in by what the user enters in by the date at the top. The date entered at the top would most likely be on a Wednesday then I need...
6
by: MROPARTNER | last post by:
I have a field in a form called "Date" I am looking to fill this text field with the current date. Is there a way to do this with ASP or an easier way? Thanks Bill
19
by: Alex | last post by:
Hello list This question has probably already been asked, but let me ask again I have a mysql database to which I connect with my php scripts. The database contains articles. Name, Unit_Price...
9
by: AA Arens | last post by:
A) I have a button on my form. By a push, I want to fill present date and time in the two rows of the table. Form Name: Company Table Name: Company consists Company ID as primary key, and...
1
by: Kev | last post by:
Hello I have a form (RosterForm) based on a table - RosterRange RosterRange has 4 fields: RosterRangeID Autonumber RosterStartDate Date RosterEndDate Date (probably...
2
by: bruce24444 | last post by:
I have designed a database for work, which creates reports from specific start and end dates. What I'd like to add to this form is a calendar dropdown where you would click a specific date on a...
0
by: dprjessie | last post by:
Hello, I am a Web programmer and I'm working on my first desktop application as a favor for a friend. I'm sure I have a stupid error here, but there is no error being thrown so I can't figure out...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.