This topic is locked
[SOLVED]

 Auto display date, timestamp and user name in text box on edit

12/18/2012 1:30:32 PM
PHPRunner General questions
C
chingupt author

Dear php runner experts,
Have a small query for you all.
I have a comments section in my list of records.

For each record, upon editing, the comments box should display the current date, time stamp and the (logged in)user name and the cursor should come after this.
How can this be acheived?
Regards

C
cgphp 12/18/2012

In the "Process record values" event of the edit page, enter the following code:

$values['comments'] = now() . " " . $_SESSION['UserID'];


Replace comments with the real name of the comments field.

C
chingupt author 12/18/2012

Thanks it solves the problem. But it does not solve the complete problem.
Suppose the first time, user edits a record.

It save the comments as

date1 user <comments>
Next time user edits the record, it should come as
---------

[date2 user2]

Comments
---------
Means, the date and user name should come in brackets and every edit should be with a line break.
Can this be acheived?

C
chingupt author 12/18/2012

I was able to acheive the braces part before and after the date and username. but how do i get the line breaks?

C
cgphp 12/19/2012

Keep comments and meta data in different fields.