I'm trying to display an Alert message through ajaxSubmit as successful as in the example code below:
submitHandler: function( form ){
var dados = $( form ).serialize();
$.ajaxSubmit({
type: "POST",
url: "...",
data: dados,
complete: function( data )
{
// $("#cargo").resetForm();
alert("Alert Message");
$("#txtNome").focus();
$("#txtNome")
.hide()
.show("slow");
document.getElementById("cargo").reset();
}
});
return false;
}
But every time the form data is saved, but no Alert message is shown! Can anyone help me?
check this code. It is working.
jQuery('#formId').validate({
submitHandler: function(form) {
jQuery("#formId").ajaxSubmit({
success: function(data) {
alert("hello");
jQuery('#element').html(data);
},
data: {ajax:'true', tab:'true'}
});
}
});
Put your code in this format.