Validación de formulario de posición absoluta Envío en caso de falla

Im trying to set up my form with Postion Absolute jQuery Form Validation https://github.com/posabsolute/jQuery-Validation-Engine and am having a little problem. When i click submit, the errors will pop up correctly, however the form submits anyway, regardless if required fields arent filled in correctly.

Heres my necessary code:

<script>
        jQuery(document).ready(function(){
            // binds form submission and fields to the validation engine
            jQuery("#formID").validationEngine();
        });
    </script>
</head>

....

<form  method="post" id="formID" action="sendform.php">

...

<input name="Submit" class="submit" type="submit" id="submit" />

Let me know if you need any more info. Once again, when i click submit, the error dialoges pop up, but the form is submitted anyway. Any suggestions?

preguntado el 22 de mayo de 12 a las 20:05

can we see your submit handler? -

@ramison dont have one, i assumed it was included in the jQuery Validation script -

you can customize the handler, it has onFailure event which helps you prevent form submission. -

@Raminson And then what? -

1 Respuestas

Prueba esto:

jQuery("#formID").validationEngine('attach', {
  onFailure: function(form, status){
    alert("The form status is: " +status+", it will never submit");
  }  
});

Respondido 17 Jul 12, 13:07

Disregard the last comment it was incorrect and has been deleted. So whats happening is its still submitting. The only time, interestingly, that i see the alert only when a required field is focused and then left.So i guess the form is being submitted, then validated. We need opposite - Jonás Katz

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.