PreEdit or PostEdit not working to setValue
PreEdit or PostEdit not working to setValue
PreCreate is working !
->on('preCreate', function($editor, $values) {
if (($values['field1'] + $values['field2'] + $values['field3'] + $values['field4']) > 29) {
$_SESSION['user_who']['sumarization'] = "yes";
} else $_SESSION['user_who']['sumarization'] = "no";
$editor
->field('question')
->setValue($_SESSION['user_who']['sumarization']);
})
PreEdit is not working
->on('preEdit', function($editor, $values) {
if (($values['field1'] + $values['field2'] + $values['field3'] + $values['field4']) > 29) {
$_SESSION['user_who']['sumarization'] = "yes";
} else $_SESSION['user_who']['sumarization'] = "no";
$editor
->field('question')
->setValue($_SESSION['user_who']['sumarization']);
})
PostEdit is not working
->on('postEdit', function($editor, $values) {
if (($values['field1'] + $values['field2'] + $values['field3'] + $values['field4']) > 29) {
$_SESSION['user_who']['sumarization'] = "yes";
} else $_SESSION['user_who']['sumarization'] = "no";
$editor
->field('question')
->setValue($_SESSION['user_who']['sumarization']);
})
Please you help and thank you very much :-)
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
postEdit
won't row because the value has already be set on the database.preEdit
however should work. Could you show me your full PHP and also state what version of Editor it is that you are using please?Do you get any errors shown in the server's error log or anywhere else?
Thanks,
Allan
This is solved because I forget add to $id to preEdit - repaired: