ripple-core
Version:
Ripple is an interactive audience response system that allows presenters to survey audience members in real time communication through their mobile devices.
33 lines (29 loc) • 880 B
JavaScript
$(function(){
var rv = new ResetValidator()
, passInput = $('#pass-tf')
, confirmInput = $('#confirm-tf');
$('#set-password-form').ajaxForm({
beforeSubmit : function(formData, jqForm, options){
rv.hideAlert();
// Check for valid password
if (!rv.validatePassword( passInput.val() ) ) {
passInput.focus();
return false;
}
// Check for confirmed password
if ( !rv.confirmPassword( passInput.val(), confirmInput.val() ) ) {
passInput.focus();
return false
}
return true;
},
success : function(responseText, status, xhr, $form){
rv.showAlert("Your password has been reset.", "success");
setTimeout(function(){ window.location.href = '/'; }, 3000);
},
error : function(){
rv.showAlert("I'm sorry something went wrong, please try again.");
}
});
passInput.focus();
});