8
With the following function below, I can send the data via ajax quietly in Chrome, but when testing in Firefox, no error occurs and the 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;
}
});
What error happens when you try to send in Firefox? Could you please tell us?
– PauloHDSousa
Can you create an example in jsFiddle that has the problem you refer to? (or maybe @Paulohdsousa?)
– Sergio