peterpetrov
New Member
Hello,
This is my scenario:
table1___access_level - drop-down with 3 entries
1, access1
2, access2
3, access3
table1___another - field where it has to be populated on form submission.
i am using php form plugin for that with onBeforeStore. The code is as follows:
--------------
$access - $formModel->getElementData('table1___access_level', true);
if ($access === '1'){
$formModel->updateFormData('table1___another', '5', true);
}
elseif ($access === '2'){
$formModel->updateFormData('table1___another', '9', true);
}
elseif ($access === '3'){
$formModel->updateFormData('table1___another', '11', true);
}
---------------
I am unable to make any of the 'if's to happen even if it is just single one.
This is my scenario:
table1___access_level - drop-down with 3 entries
1, access1
2, access2
3, access3
table1___another - field where it has to be populated on form submission.
i am using php form plugin for that with onBeforeStore. The code is as follows:
--------------
$access - $formModel->getElementData('table1___access_level', true);
if ($access === '1'){
$formModel->updateFormData('table1___another', '5', true);
}
elseif ($access === '2'){
$formModel->updateFormData('table1___another', '9', true);
}
elseif ($access === '3'){
$formModel->updateFormData('table1___another', '11', true);
}
---------------
I am unable to make any of the 'if's to happen even if it is just single one.