I need to make a field required if another field is empty, and Iām doing it with āoperatorsā, as described here, using the following code, but the field empty does not ātriggerā the required correctly. Can you tell me how to detect if a field is empty?
$dictionary['Account']['fields']['fiscal_code_c'] = array(
'name' => 'fiscal_code_c',
'vname' => 'LBL_FISCAL_CODE',
'type' => 'varchar',
'len' => 16,
'default' => ' ',
'comment' => 'Codice Fiscale',
'merge_filter' => 'enabled',
'logic' => [
'required' => [
'key' => 'required',
'modes' => ['edit', 'create'],
'params' => [
'fieldDependencies' => [
'vat_number_c'
],
'activeOnFields' => [
'vat_number_c' => [
['operator' => 'is-empty']
],
],
],
]
],
);
My problem is that the operator [āoperatorā => āis-emptyā] doesnāt trigger the empty field. Any suggestion?