$(document).ready(function(){ var d = new Date(); var optionsResend = { dataType: 'json', beforeSubmit: doResendPassword, success: successResendPassword, url: '/myEquiGaia/ajaxResendPassword/'+d.getTime(), resetForm: false }; $("#frmResendPassword").ajaxForm(optionsResend); $("#frmResendPassword").validate({ rules: { email: { required: true, email: true } }, messages: { email: { required: "Vi pregiamo di inserire la vostra e - mail e la parola d’ordine", email: "Il vostro indirizzo e – mail deve essere nel formato: nome@demanio.com" } } }); function doResendPassword(formData, jqForm, options) { if($("#frmResendPassword").valid()) { onSubmit("#frmResendPassword"); return true; } else return false; } function successResendPassword(data) { var afterSubmitParams = new Array(); if(data['success'] != undefined && data['success'] == 1) { afterSubmitParams["isError"] = false; $("#resendPasswordResult").html("La password è stata inviata alla tua email. Riceverai la posta in poco tempo.
Quale sarà il vostro prossimo passo?
Vorrei:
"); } else { $("#resendPasswordResult").html("La password non è stata inviata. Esiste gia` un'utente con questo indirizzo"); afterSubmitParams["isError"] = true; } afterSubmitParams["frmId"] = "#frmResendPassword"; afterSubmitParams["resultLayout"] = "#resendPasswordResult"; afterSubmitParams["doScroll"] = false; afterSubmit(afterSubmitParams); } });