I am trying to validate in a submit block with a post call in which I consult a web service, and depending on the result I allow the submit or not, but it never enters the post function and makes the submit automatically.
this is the code
$(document).off('submit','#formulario_preregistro',function(event)
{
event.stopPropagation();
numeroSerie=$("#serie_valida").val();
$.post("chws.php", {Serie:numeroSerie}, function(valid)
{
alert(valid);
if (valid == 1 || valid == 2)
{
return true;
}
else
{
alert('EL NuMERO DE SERIE DE SU PRODUCTO ES INVaLIDO');
event.stopPropagation();
}
});
});