Jump to content


This topic is now archived and is closed to further replies.


Adding date to hidden field

Recommended Posts

i hope someone can help me, i am still very new to coding

[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]strOutput += "<TD CLASS=\"entry\<input type=hidden name=Date value="???????????"></TD>";[!--colorc--][/span][!--/colorc--]

is the above code correct so far and what do i have to replace ????????????????? with so that it will save todays date (and time if possible) into my database

anyone who can help me please greatly appreciated


Share this post

Link to post
Share on other sites
Hi there,

To get the date using javascript,, you could try something like:

var d=new Date();

<td><input type=hidden name=Date id=Date></td>

// debug line:
alert('date is: '+document.getElementById("Date").getAttribute("value"));

Some tips (hmm, maybe in french,,) on this site: [a href=\"http://www.asp-php.net/tutorial/scripting/dates.php\" target=\"_blank\"]date functions & javascript[/a]

But you will need to use php/Mysql to save the dates into your database,...

So, better use php like:
1- get the date with php date function,
2- save it using mysql into a database

Hoping it helps,


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.