im does a form check and I want to check the input fields when "on submit" if Im error using jquery.scrollTo to go to the error:
$('#form_inscripcion').submit(function() {
var $inputs = $('#form_inscripcion :input');
$inputs.each(function() {
var encontro_error = validar($(this));
if (encontro_error){
$.scrollTo( 'input#'+$(this).attr('id'), 800 );
return false;
}
});
});
The problem is that when an error is returned, it does not cancel the sending, it does not start the line return false;.
It works fine when
<form id="form_inscripcion" name="form" method="post" action="some" onsubmit="return false">
But it will never obey. I hope you understand me :) thanks :)
source
share