0

I am validating a form using XML validation. When I submit this with an empty field, an error message pops out. If I resubmit the form without filling the field appropriately, another error will pop on top of the first error. Next, if I fill the field with data; the error messages will still not disappear and the form will not submit.

As you can see, the validator adds errors to fields as these are empty.

Next, I have filled the 'Name' field and submitted the form again. As you can see, the field error is still on top of 'Name' field and another error appeared on top of 'Surname' field.

validation.xml

<validators>

<field name="name">
    <field-validator type="requiredstring">
        <message>Name is required!</message>
    </field-validator>

</field>

<field name="surname">
    <field-validator type="requiredstring">
        <message>Surname is required!</message>
    </field-validator>
</field>

</validators>
Bravo
  • 1,944
  • 4
  • 29
  • 53

0 Answers0