Validation Engine One by one error display
Asked Answered
E

6

5

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?

Extreme answered 29/4, 2012 at 16:53 Comment(0)
F
3

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});
Friesland answered 8/8, 2013 at 5:13 Comment(0)
N
5

try changing

showOneMessage true

Negligent answered 26/12, 2012 at 11:46 Comment(1)
a mixture of both do work.. if ($('form.wpcf7-form').length) { $.validationEngine.defaults.scroll = true; $.validationEngine.defaults.autoHidePrompt = true; $.validationEngine.defaults.autoHideDelay = 5000; $.validationEngine.defaults.showArrow = true; $.validationEngine.defaults.autoPositionUpdate= true; $.validationEngine.defaults.maxErrorsPerField= true; $.validationEngine.defaults.showOneMessage= true; $('form.wpcf7-form').validationEngine();Nolie
F
3

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});
Friesland answered 8/8, 2013 at 5:13 Comment(0)
H
1

Try this:

<input value="" class="validate[required]" type="text" name="FirstName" id="fname">
<input class="validate[condRequired[fname]]" type="text" name="LastName" id="lname">
Hamel answered 5/7, 2013 at 11:57 Comment(0)
B
0

I believe the option you are looking for is:

// Used when you have a form fields too close and the errors messages are on top of other disturbing viewing messages doNotShowAllErrosOnSubmit: false

Benefit answered 17/5, 2012 at 21:12 Comment(0)
P
0

try this:

showErrors: function(errorMap, errorList) {
    this.defaultShowErrors();
    $("#changepass label.error:visible").each(function(index,value){
        if(index)
            $(this).hide();
    });
},
onkeyup: false,
onclick: false,
onfocusout: false
Photon answered 5/11, 2014 at 5:39 Comment(0)
S
0

set maxErrorsPerField property to true

    $("#formid").vaidationEngine({ maxErrorsPerField:true});
Sandpit answered 1/9, 2016 at 16:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.