VOI
Member
Hi,
I am trying to set some data after a form is submitted/updated. That is a counter for the times the form has been saved and the time of the last modification.
To do this I am using the form plugin php with 'Process Script' set to 'onAfterProcess' and the following code:
However, the value of the two fields "log_views" and "log_last_modified" within the table 'projects' stay the same.
Neither altering the synatax by including a '_raw' after the element name and/or a ', true' after that as seen in some posts and the tooltip of the PHP code field nor changing the value of "Process Script" from 'onAfterProcess' to 'onLoad' or 'onBeforeProcess' showed any effect.
What am I doing wrong here?
Chris
I am trying to set some data after a form is submitted/updated. That is a counter for the times the form has been saved and the time of the last modification.
To do this I am using the form plugin php with 'Process Script' set to 'onAfterProcess' and the following code:
Code:
$views = $formModel->_formData['log_views'];
$formModel->updateFormData('projects___log_views', $views);
$now = time();
$formModel->updateFormData('projects___log_last_modified', $now);
However, the value of the two fields "log_views" and "log_last_modified" within the table 'projects' stay the same.
Neither altering the synatax by including a '_raw' after the element name and/or a ', true' after that as seen in some posts and the tooltip of the PHP code field nor changing the value of "Process Script" from 'onAfterProcess' to 'onLoad' or 'onBeforeProcess' showed any effect.
What am I doing wrong here?
Chris