Help please for form validation (with php, ajax and jquery)

Help please for form validation (with php, ajax and jquery)

The error is that sends output to email: when required as the field is 8 characters


Where is the error, please?


  1. $(document).ready(function() {

  2. $(function(){  

  3. $("#myform").validate({

  4. submitHandler: function(form) {
  5.     $(document).ajaxStart(function() {
  6.         $('#loading').show();
  7.         $('#result').hide();
  8.     }).ajaxStop(function() {
  9.         $('#loading').hide();
  10.         $('#result').fadeIn('slow');
  11.     });
  12.     },
  13.     rules: {
  14.         
  15.      Nombre: {
  16.                 required: true,
  17.                 minlength: 8
  18.             }
  19.     }

  20.     });

  21. });



  22.     $('#myform').submit(function() {
  23.         $.ajax({
  24.             type: 'POST',
  25.             url: $(this).attr('action'),
  26.             data: $(this).serialize(),
  27.             success: function(data) {
  28.                 $('#result').html(data);

  29.             }
  30.         })
  31.         
  32.         return false;
  33.     }); 
  34. })  


MIKEPIANIST