Checkbox change value in databasejoin element

procajlok

Member
Hello!
In complicated form in first group i have displayonly databasejoin element "Your registration status" (this element is displayonly because status can change only admin). Only on status id=3 users can edit record. Other status block edit by caneditrow listplugin.
On last group i have checkbox "I finish - send to verification" (it have value =1).​

Question - when user tick checbox and save record, i want to change registration status to id=4. How i can do that? Maybe not through the checkbox, maybe through the button?
 
Best to do that with a PHP form submission plugin, running onBeforeProcess.

Something like ...

Code:
if (is_array($formModel->formData['yourtable___checkbox']) && in_array('1', $formModel->formData['yourtable___checkbox']) {
   $formModel->updateFormData('yourtable___status', array('4'), true);
}

Change the full element names as appropriate.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top