Search code examples
jqueryjquery-validation-engine

Validation Engine One by one error display


I prefer Jquery ValidationEngine over Bassistance validation. my question is

We do not use one input per line, some of them are in the same line like First Name: [] Last Name: []

When errors popup, the error messages overlap and they look so ugly.

Can I do something to validation engine, that it shows only First most error and when the error is fixed and user tries to submit form the other first most error (if exists) will show there.

real life example:- For example First name and last name both are REQUIRED and both fields are empty user tries to submit but he sees only one error on First Name, he types his first name as "Asif" , then he tries to submit now he sees second error on Last Name field he input last name "Ashraf" and then the form is good to go.

Can we achieve that?


Solution

  • If we have to show one error at a time per field field then we will use

    maxErrorsPerField:1
    

    It will be like

    $("#form_id").validationEngine('attach', { maxErrorsPerField:1});