Hello,
Please tell me which is the correct syntax to unset the data in a form (also for repeat groups). I've tried the following syntax's onBeforeStore/onBeforeProcess, can't make it work, the form still record the data.
$foo is getting the correct value as string, but the Unset trigger doesn't run. I need to unset data every time an element (yes/no, dbjoin, cdd etc) have the default value set to zero.
Thank you
Please tell me which is the correct syntax to unset the data in a form (also for repeat groups). I've tried the following syntax's onBeforeStore/onBeforeProcess, can't make it work, the form still record the data.
$foo is getting the correct value as string, but the Unset trigger doesn't run. I need to unset data every time an element (yes/no, dbjoin, cdd etc) have the default value set to zero.
PHP:
$foo = $formModel->getElementData('mytable___myelement', true);
if ($foo[0] == '0') {
unset($_REQUEST['join'][2183]);
}
PHP:
$foo = $formModel->getElementData('mytable___myelement', true);
if ($foo[0] == '0') {
unset($this->_formData['join'][2183]);
}
PHP:
$foo = $formModel->getElementData('mytable___myelement', true);
if ($foo[0] == '0') {
unset($formModel->_formData['join'][2183]);
}
Thank you