[jQuery] jquery.validation and ajax
Hi everybody,
sorry for my english and.. sorry for my js code (newbie :-()
I have this:
$().ready(function() {
// validate signup form on keyup and submit
$('#form_inserisci_commento').ajaxForm({
target: '#successDiv',
// success identifies the function to invoke when the server
response
// has been received; here we apply a fade-in effect to the new
content
success: function() {
$('#inserisci_commenti').fadeOut('slow');
//$('#loadingDiv').show();
$('#successDiv').fadeIn('slow');
}
}),
$("#form_inserisci_commento").validate({
event: "keyup",
rules: {
nominativo: { required: true, minLength: 2 },
localita: { required: true, minLength: 2 },
messaggio: { required: true, minLength: 2 }
},
messages: {
nominativo: "<p class=\"error\">Inserisci il tuo
Nominativo",
localita: "<p class=\"error\">Inserisci la Località di
provenienza",
messaggio: "<p class=\"error\">Inserisci il tuo
Messaggio"
}
});
});
I wrong something 'cause the ajax call run but not the validation...
Or better, the ajax call run when the form is not valid too.
I need help, please.
Thank you