By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 2,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Fill a form field using ASP ??

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
Thanks! Worked great.

Nov 19 '05 #3

P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.