File manager - Edit - /home/gzbnyc5/pty-app/realstate/public/assetsv2/modified/js/custom/authentication/password-reset/password-reset.js
Back
"use strict"; // Class Definition var KTPasswordResetGeneral = function() { // Elements var form; var submitButton; var validator; var handleForm = function(e) { // Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/ validator = FormValidation.formValidation( form, { fields: { 'email': { validators: { notEmpty: { message: 'Email address is required' }, emailAddress: { message: 'The value is not a valid email address' } } } }, plugins: { trigger: new FormValidation.plugins.Trigger(), bootstrap: new FormValidation.plugins.Bootstrap5({ rowSelector: '.fv-row', eleInvalidClass: '', eleValidClass: '' }) } } ); submitButton.addEventListener('click', function (e) { e.preventDefault(); // Validate form validator.validate().then(function (status) { if (status == 'Valid') { // Show loading indication submitButton.setAttribute('data-kt-indicator', 'on'); // Disable button to avoid multiple click submitButton.disabled = true; $.ajax({ url: '', dataType: 'JSON', type: 'POST', data: $(form).serialize(), success: function(response, status, xhr, $form) { submitButton.removeAttribute('data-kt-indicator'); // Enable button submitButton.disabled = false; if(response.error == 0) { Swal.fire({ text: "Cool! Password recovery instruction has been sent to your email.", icon: "success", buttonsStyling: false, confirmButtonText: "Ok, got it!", customClass: { confirmButton: "btn btn-primary" } }).then(function (result) { window.location.href = "/rs-admin-v2"; }); } else { // Show error popup. For more info check the plugin's official documentation: https://sweetalert2.github.io/ Swal.fire({ text: "Sorry, looks like there are some errors detected, please try again.", icon: "error", buttonsStyling: false, confirmButtonText: "Ok, got it!", customClass: { confirmButton: "btn btn-primary" } }); } } }); } else { // Show error popup. For more info check the plugin's official documentation: https://sweetalert2.github.io/ Swal.fire({ text: "Sorry, looks like there are some errors detected, please try again.", icon: "error", buttonsStyling: false, confirmButtonText: "Ok, got it!", customClass: { confirmButton: "btn btn-primary" } }); } }); }); } // Public Functions return { // public functions init: function() { form = document.querySelector('#kt_password_reset_form'); submitButton = document.querySelector('#kt_password_reset_submit'); handleForm(); } }; }(); // On document ready KTUtil.onDOMContentLoaded(function() { KTPasswordResetGeneral.init(); });
| ver. 1.4 |
Github
|
.
| PHP 8.3.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings