Auto insert date and time in form input field?
Posted
by Mo Boho
on Stack Overflow
See other posts from Stack Overflow
or by Mo Boho
Published on 2009-06-16T14:42:57Z
Indexed on
2010/03/25
1:23 UTC
Read the original article
Hit count: 397
Using javascript, how can we auto insert the current DATE and TIME into a form input field.
I'm building a "Problems" form to keep track of user submitted complaints about a certain service. I'm collecting as much info as possible. I want to save the staff here from having to manually enter the date and time each time they open the form.
I have this snippet of code:
<input id="date" name="date" value="javascript:document.write(Date()+'.')"/>
but it's not working.
many thanks for any help.
© Stack Overflow or respective owner