With the following function below, I can send the data via ajax quietly in Chrome, but when testing in Firefox, no error occurs and data is not sent.
$('#form_lista_amiga').validate({
rules : {
cpf: { required: true, cpf: true }
},
submitHandler: function(form) {
var data = $( form ).serialize();
event.preventDefault();
$.ajax({
url: "<?php echo Router::url(array('controller' => 'ListaAmiga', 'action' =>'add'), true); ?>",
type: 'POST',
datatype: 'json',
data: data,
success: function(data){
$('#lista_amiga_msg').html(data);
// alert(data);
}
});
return false;
}
});