I have a field that appears on the page, only if the user selects a specific option.
(javascript).
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:
$dominio_ref=$_POST[‘dominio2’];
We can access a specific property of this array by doing:
$dominio_ref[11] for the option number eleven (from 0).
Will isset($dominio_ref[11]) do the trick?
I cannot test it because this system is quite a mess and I cannot replicate locally.
Please advice,
Márcio