473,785 Members | 2,794 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4881
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********@com cast.net> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.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********@com cast.net> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.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********@com cast.net> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.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="WorkOrd ers_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********@com cast.net> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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********@com cast.net> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.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********@com cast.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
6450
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", which launches a new window with a page from a different domain, say appB.mycom.com/bb.html. In the form myForm of aa.html, there is a field called URL. <html> <body> <form name="myForm"> <input type="button" value="Launch"...
4
5372
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 off the same boxes each time. I'd like to automate this. I need to load the URL for the login page into the browser, fill in my username and password, and submit the form. From that page I need to follow a link to file for benefits. There I...
2
1604
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. Firstname = Adam, Lastname = Apple, Username = AdamA
8
4862
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 people. E.g. custommer number 14 will get a link from me like this one: http://www.myname.com/form.php?number=14
1
6588
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 the underlying table this immediate if field contains the default value that was set when originally setting up the table and the form. =IIf(=10100100, "CR", "DB") => this works well in the flow of the form but does not actually populate the...
4
4714
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
1270
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 out this weekend. If you have your address set up in your Form Fill function, any form that has these fields (name, address, city, phone etc) will automatically be filled in. MSN has a toolbar you can download for IE, that is something I am...
106
19835
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 gladly delete my question an put it in the correct section. Well what i am trying to do is pretty simple. I have a input field and someone starts typing in a customer number. As they type in the customer number the drop down box is populated. They...
1
2526
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 script doesn't have any form tag? Such as this one below: <html> <body> Enter Hostname: <input type="text" name="host_name" id="host_input"/> <input type="submit" value="Investigate!" onClick="populate();"/> <br/> </body>...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10329
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8974
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.