kaayru / jquery-valideasy

jQuery Valideasy
http://kaayru.github.io/jquery-valideasy
GNU General Public License v2.0
24 stars 6 forks source link

Problem when div errror is not empty #3

Open bmoinet opened 10 years ago

bmoinet commented 10 years ago

If you have an div to display error messages and this div is not empty, then the plugin doesn't work corretly (the message is not displayed). You then have to give focus to the field before to submit the form and then have the message. Ex:

=> OK

=> KO

Form example :

bmoinet commented 10 years ago

The JS script used :

$(document).ready(function(){

/**
 * Search Form Submit Behavior
 */
$('#recherche #submit_btn').on('click', function(e) {

    var form = $(this).closest('form');
    var isValid = form.valideasy({
        mode: 'unified', 
        errorElementId: 'errors',
        stepByStep: true,
        disableFieldStyle: true
    });

    if (isValid) {
        form.submit();
    }

    return isValid;

});

});