rmt123 Posted April 28, 2006 Share Posted April 28, 2006 Hii 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 databaseanyone who can help me please greatly appreciatedregardsscottt Quote Link to comment https://forums.phpfreaks.com/topic/8627-adding-date-to-hidden-field/ Share on other sites More sharing options...
GBS Posted April 28, 2006 Share Posted April 28, 2006 Hi there,To get the date using javascript,, you could try something like:[code]<html><body><script>var d=new Date();</script><table><tr><td><input type=hidden name=Date id=Date></td></tr></table><script>document.getElementById('Date').setAttribute("value",d);// debug line:alert('date is: '+document.getElementById("Date").getAttribute("value"));</script></body></html>[/code]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 databaseHoping it helps,l8tr,, Quote Link to comment https://forums.phpfreaks.com/topic/8627-adding-date-to-hidden-field/#findComment-31715 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.