IT Community - Software Programming, Web Development and Technical Support

Date/Time stamp a form field as the form is submitted

This is a discussion on Date/Time stamp a form field as the form is submitted within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... Can anyone help me how can i date/time stamp a form field as the form is submitted. ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-14-2008, 05:21 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default Date/Time stamp a form field as the form is submitted

Hi all...

Can anyone help me how can i date/time stamp a form field as the form is submitted.

Thanks in advance...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-14-2008, 05:28 AM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 237
Pvinothkumar is on a distinguished road
Default Re: Date/Time stamp a form field as the form is submitted

Hi all...

<script language="JavaScript">
function stamp() {
document.myForm.dateandtime.value = new Date();
}
</script>

<form name="myForm" onSubmit="stamp()">
<input type="hidden" name="dateandtime">
<input type="submit">
</form>

Thanks...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 08:47 PM
GDevakii GDevakii is offline
D-Web Sr.Programmer
 
Join Date: Aug 2007
Posts: 138
GDevakii is on a distinguished road
Smile Re: Date/Time stamp a form field as the form is submitted

<html>
<head>
<title>Get submitted date</title>
<script type="text/javascript">
function addDate(form)
{
var day = new Date();
var submitted = (+day.getHours()+':'+day.getMinutes());
form.submitted_date.value=submitted;
}
</script>
</head>
<body>

<form method="post" onSubmit="return false;">
<input type="text" name="submitted_date" value="">
<!-- rest of your form -->
<input type="submit" onClick="addDate(this.form);" value="Submit">
</form>



</body>
</html>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/html-css-javascript-coding-techniques/4968-date-time-stamp-form-field-form-submitted.html
Posted By For Type Date
DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 01-15-2008 08:42 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prefill a text form field with the current date. itbarota HTML, CSS and Javascript Coding Techniques 1 03-18-2008 09:09 PM
store the current date in a hidden form field. itbarota HTML, CSS and Javascript Coding Techniques 1 02-10-2008 09:36 PM
Date/time stamp a form field as the form is submitted itbarota HTML, CSS and Javascript Coding Techniques 1 02-06-2008 10:16 PM
Date and time displayed in a hidden form field. itbarota HTML, CSS and Javascript Coding Techniques 2 02-01-2008 09:47 PM
How can I clear the form field values after the user has submitted the form for clien itbarota HTML, CSS and Javascript Coding Techniques 1 11-01-2007 11:39 PM


All times are GMT -7. The time now is 11:15 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0