In the admin side I have a XML form with 2 fields as below. Both the fields are marked as required=true
<field name="field1"
type="text"
label="Field1"
required="true"/>
<field name="field2"
type="text"
label="Field2"
required="true"/>
In the admin form (default.php) the fields are sown as below. field2
is required only on certain condition.
echo $this->form->renderField('field1');
if (condition){
echo $this->form->renderField('field2');
}
When this form is getting submitted the server side validation validates both the fields irrespective on what is displayed on the form. I want to setup in such a way that validation only validates what's in the form.