Forums

Timestamp not updating

spectsteve7 04 Jan, 2012
Hi All,

Stuck here and hoping someone could point me in the right direction. I have a page that lists records with a button to edit the records. When updating a record I have a hidden field with a php timestamp <!--<?php echo(date("Y-m-d H:i:s")); ?>-->. My problem is that the timestamp records when a new record is inserted but when the record is edited the hidden fields value pulls from the database rather than updating to the new date. Has anyone ever run into this issue and found a solution?

Thanks in advance.
GreyHead 08 Jan, 2012
Hi spectsteve7,

If you are using ChronoForms to save the data it will automatically update the 'recordtime' column *unless* there is already a value set for 'recordtime' in which case it assumes that you've deliberately set it and uses that value.

The simplest solution is probably to remove your hidden input and let ChronoForms do the work. If you need to set it then you can add PHP in the On Subit Before Email box to set the timestamp there rather than load it from the old record.

Bob
This topic is locked and no more replies can be posted.