PHP Classes

File: account/assets/js/recovery.js

Recommend this page to a friend!
  Classes of Mohamed Elbahja   PHP Secure Login Library   account/assets/js/recovery.js   Download  
File: account/assets/js/recovery.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Secure Login Library
Login users and start sessions in a MySQL database
Author: By
Last change:
Date: 7 years ago
Size: 1,479 bytes
 

Contents

Class file image Download
$(document).ready(function() { $("#recovery").validate({ rules: { password: { required: true, minlength: 6 }, repassword: { required: true, equalTo: '#password' } }, messages: { repassword: { equalTo: 'the passwords did not match', } }, submitHandler: function() { var data = $('#recovery').serialize(); $.ajax({ type: 'POST', url: 'submit/recovery.php', data: data, beforeSend: function() { $("#form-message").fadeOut('fast'); $("#btn-submit").html(' Sending... '); $("#btn-submit").attr('disabled', true); }, success: function(r) { if (r === 'success') { $("#btn-submit").attr('disabled', true); $("#btn-submit").html( r + ', Redirect... '); setTimeout(window.location.href = 'login.php', 5000); } else { $("#form-message").fadeIn(0, function() { $("#form-message").html('<div class="alert btn-danger"> ' + r + ' </div>'); $("#btn-submit").html(' Change password'); $("#btn-submit").attr('disabled', false); }); } } }); return false; } }); });