473,402 Members | 2,053 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,402 software developers and data experts.

Fill a form field using ASP ??

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

Nov 19 '05 #1
6 4864
ASP:

<input type="text" name="myText" size="20" value="<%=Now%>">

or client-side javascript:

<script type="text/javascript"><!--
document.forms[0].myText.Value = new Date();
// --></script>
<input type="text" name="myText" size="20">

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

<MR********@comcast.net> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
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

Nov 19 '05 #2
Thanks! Worked great.

Nov 19 '05 #3
ASP.NET or ASP?

<MR********@comcast.net> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
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

Nov 19 '05 #4

Either one would be fine. I used the example above and it worked as
far as filling the field on my form with the date, but when the submit
button is hit the page just reloads. The form is not sent. The form
was made using Frontpage 2000. Any ideas?

My form can be found at:

http://mropartner.com/WorkOrders_Test.asp

Thanks

Peter Rilling wrote:
ASP.NET or ASP?

<MR********@comcast.net> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
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


Nov 19 '05 #5
You may want to bone up on how ASP works. My web site
(http://www.takempis.com) has a number of beginner articles and tutorials
that can be helpful to you.

The form is indeed sent. The "Action" attribute of a form indicates the
resource that should handle the form post. In your case, you specified that
the form handler was the same page. Here's the HTML from your form tag:

<FORM METHOD="POST" action="WorkOrders_Test.asp"
webbot-action="--WEBBOT-SELF--">

Note that the handler is the same as the form page itself. The page posts
back to itself.

It looks like you originally created a FrontPage form that is handled by
FrontPage server extensions, and then renamed the form with a .asp
extension. Once you do that, you cannot use FrontPage form handlers for the
form. It has to be handled by an ASP page. In other words, you have to write
your own custom ASP form handler. Again, see my web site to learn the ropes
of ASP.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

<MR********@comcast.net> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Either one would be fine. I used the example above and it worked as
far as filling the field on my form with the date, but when the submit
button is hit the page just reloads. The form is not sent. The form
was made using Frontpage 2000. Any ideas?

My form can be found at:

http://mropartner.com/WorkOrders_Test.asp

Thanks

Peter Rilling wrote:
ASP.NET or ASP?

<MR********@comcast.net> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
> 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
>

Nov 19 '05 #6
Hello Bill,
On my submission_form.asp I also have a date field and I wanted it to
automatically fill in the date.
Double-click on the Text Box to get to the properties.
In the Initial Value field type: <%=Date%>

Now when the users submit the form and it feeds back into my database the
date come through just fine. But, just a word of caution. I might have had
to edit my database field properties to make sure it had date format. I
don't remember. I did a lot of going back and forth to get the date and time
fields to do what I wanted them to do.
Hope it helps
"MR********@comcast.net" wrote:
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

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Song Zhang | last post by:
I need to write asp/script/html code to fill the following function. 1. When a page appA.mycom.com/aa.html (aa.html code shown below) is visited from my site, a user can click the button "Launch",...
4
by: Barry Margolin | last post by:
Can I do the following with Javascript? My state has a web site that can be used for online filing for unemployment benefits. Every week I have to go to the site and fill in a form, checking...
2
by: RelaxoRy | last post by:
I have 3 texfield boxes 1. firstname 2. lastname 3. username When a person enters in their firstname and lastname, I want the username field to fill with firstnameLastinitial. Eg. ...
8
by: Moozie | last post by:
I have a form that people can fill out. Link looks like: http://www.myname.com/form.php A regular form, nothing special. Now I would like to fill out 1 field automatically by the link I give...
1
by: ogilby1 | last post by:
Using an immediate if to fill a field on a form based on the value of another field. During data entry on the form this methodology works well. When looking at the results in the datasheet view or...
4
by: Sherwood Botsford | last post by:
Table Markers ID (Primary Key) This&That PointClass (Combo box) Points Table PointClasses PointClass (primary key) Points (number) Description (Text)
0
by: tshad | last post by:
MSN has a toolbar that has a Form Fill function that will try to fill form fields on forms when they come up. The problem is that it causes problems with some forms and functions. I found this...
106
by: bonneylake | last post by:
Hey Everyone, Well i don't know if my question should be in javascript/ajax or coldfusion, i figure this is more of a coldfusion question. But if this is in the wrong section let me know an all...
1
by: yaFaheem | last post by:
This is my first exposure to perl Mech when I am trying to autofill a php script. As per perl Mechaize docs, there are numerous functions to fill out a text field and submit. However, what if the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.