Just wondering if any of you know how to set up a form so that it knows the time and date the user submitted it at, and sends that information along with the email?
I just got this message from a former teacher. But I don't know how to go about this. My form is controlled by javascript, it's just the "date stamp" that I don't understand how to do. Help, anyone?
"Yep, control the form submission via javascript and use javascript to send a date stamp with the form using the Date() object."
When the form is submitted, you could store the current date and time in a hidden field on the form using javascript. To put it simply, say you have a form form1 with a hidden field hidden1. When the user clicks submit, your could use javascript to set the value of the field before processing the form.
document.form1.hidden1.value=new Date()
and that displays the date, but I also have to display the time in the same way. I have the code for the time written out, but what string would tell it to appear in my input field? I tried something similar to the above line but it didn't work. Here is my time code.
function writeTime() {
var today = new Date();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.