I have a field that appears on the page, only if the user selects a specific option.
If the user selects that specific option, the field is required, hence, it cannot be empty.
If the user selects other option, the field doesn't appear, hence, it cannot be required.
How can we establish this relation on the php validation side, telling that, when a specific select value is in place, validate/don't validate another form field.
The select options are stored on this array:
We can access a specific property of this array by doing:
$dominio_ref for the option number eleven (from 0).
Will isset($dominio_ref) do the trick?
I cannot test it because this system is quite a mess and I cannot replicate locally.