Forums
This topic is locked
Current Date in hidden form element
Posted 22 years ago
1
has voted
22 years ago Kevin Miller posted:
I want to pass the current date(yyyy-mm-dd) in a hidden form element. What is the most non-confusing method of accomplishing this task.Regards,
Kevin
Replies
Replied 22 years ago
22 years ago han xiangzi replied:
what???
Replied 22 years ago
22 years ago Kevin Miller replied:
Yeah... I know my question is a little vague. Ok a lot vague. I'm posting form results to a SQL database. I want to pass the date of form submission with the record insert but I want the date insertion to be hidden from the user. I think I've found a solution but still welcome the experience of others.
Thanks
Thanks
Replied 22 years ago
22 years ago Marja Ribbers-de Vroed replied:
What server-side language are you using?
In ASP it would be something like:
<pre id=code><font face=courier size=2 id=code>
input type="hidden" name="dateToday" value="< % = Date() % >"
</font id=code></pre id=code>
(There shouldn't be spaces around the value, but I could not get it to display otherwise).
Hope this helps.
--
Marja Ribbers-de Vroed
www.flevooware.nl
www.flevooware.nl/dreamweaver/
In ASP it would be something like:
<pre id=code><font face=courier size=2 id=code>
input type="hidden" name="dateToday" value="< % = Date() % >"
</font id=code></pre id=code>
(There shouldn't be spaces around the value, but I could not get it to display otherwise).
Hope this helps.
--
Marja Ribbers-de Vroed
www.flevooware.nl
www.flevooware.nl/dreamweaver/
Replied 22 years ago
22 years ago Owen Eastwick replied:
Marja's answer is fine, but alternatively don't submit the value from the form at all. Submit everything else from the form to the database. Set up your "Form Submission Time" field in the database witha default value of <b>getdate()</b> (SQL Server) Now() or Date() in Access, this will automatically complete the date each time a record is added to the table.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 22 years ago
22 years ago han xiangzi replied:
yeah...