validatorjs
validatorjs copied to clipboard
Is it possible to use required_if with multiple values or AND 2 required_ifs together?
I would like both of these rules to kick in for a single field:
field_3: ['required_if:field_1,Y', 'required_if:field_2,N']
If field_1 === 'Y'
and field_2 === 'N'
, then I want field_3
to be required. Is this possible? Right now it seems like it evaluates these 2 fields separately, as an OR
.
Any news on that requirement or any workaround ? This should be very usefull to have a logical AND with required_if (required_if_all ?) Thx