Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q470 How can I date/time stamp a form field as the form is submitted?

You are here: irt.org | FAQ | JavaScript | Date | Q470 [ previous next ]

Try:

<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>

Feedback on 'Q470 How can I date/time stamp a form field as the form is submitted?'

©2018 Martin Webb