victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
971 stars 475 forks source link

cant validate using Event #604

Open davidkurniawan1980 opened 7 years ago

davidkurniawan1980 commented 7 years ago

whats wrong with my code, thanks for any suggest

<script>
$.validate({
    form:'#formSemester',
    validateOnEvent:true
});

var errors = [],

// Validation configuration
conf = {
  onElementValidate : function(valid, $el, $form, errorMess) {
     if( !valid ) {
      // gather up the failed validations
      errors.push({el: $el, error: errorMess});
     }
  }
},
lang = 'en'
;

$.formUtils.loadModules('security, date');

$('#Ctombol').on('click', function() {
   // reset error array
   errors = [];
   if( !$(this).isValid(lang, conf, false) ) {
    displayErrors(errors);
   } else {
   // The form is valid
   $('#konfirS').modal('show');
   }
});

</script>
victorjonsson commented 7 years ago

What happens? You know that isValid in incompatible with aysnc validators such as the server validator and the dimension validator?