MeAppBuilder
Member
Hello,
I am trying to run custom PHP code onBeforeProcess with a fabrik form. It is an file upload field and you are only allowed to upload 1 csv file. I am currently trying to throw a simple error message, but fabrik refuses to show those errors that I have defined with PHP:
$script = $formModel->getElementData('fabrik_file_upload___script');
if ($script == 1){
/* 1: repricing */
$formModel->errors['fabrik_file_upload___script'][] = 'error';
$formModel->getForm()->error = "csv not valid";
return false;
}
else {
$formModel->errors['fabrik_file_upload___script'][] = 'error';
$formModel->getForm()->error = "csv not valid";
return false;
}
I am getting the standard error message of a form at top and a small icon below the input field (file upload).
Is it possible to define $script and then require_once in order to include a PHP file, that can make use of the fields as variables?
I am trying to run custom PHP code onBeforeProcess with a fabrik form. It is an file upload field and you are only allowed to upload 1 csv file. I am currently trying to throw a simple error message, but fabrik refuses to show those errors that I have defined with PHP:
$script = $formModel->getElementData('fabrik_file_upload___script');
if ($script == 1){
/* 1: repricing */
$formModel->errors['fabrik_file_upload___script'][] = 'error';
$formModel->getForm()->error = "csv not valid";
return false;
}
else {
$formModel->errors['fabrik_file_upload___script'][] = 'error';
$formModel->getForm()->error = "csv not valid";
return false;
}
I am getting the standard error message of a form at top and a small icon below the input field (file upload).
Is it possible to define $script and then require_once in order to include a PHP file, that can make use of the fields as variables?