automatically setting a date field on change of a another specific field

Hello,

I have a grid application with a corresponding database table.
Among others, this table contains a decimal field for a price and date field.
This data field shall reflect when the current price was entered.

In case the user changes the price value, I would like to automatically set the date to the system date, to later be able to when that price was set.

Is this possible?

Re: automatically setting a date field on change of a another specific field

You can use the Ajax Event, in the event onChange, put a value and the another field will load other value.
Use a ifelse clause for example.

Re: automatically setting a date field on change of a another specific field

I use onBeforeInsert:

{date_created} = date('Y-m-d H:i:s');
{date_changed} = date('Y-m-d H:i:s');

and onBeforeUpdate:

{date_changed} = date('Y-m-d H:i:s');

To do this kind of operations. I set these 2 date fields label = yes, so the user can’t change them by hand.