From 038de916271aa204568c3d9e68186b023dfb5dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Thu, 20 May 2021 17:01:22 +0200 Subject: [PATCH] Add files via upload --- assets/js/checkForms.js | 22 ++++++++++++++++++++++ panel_user/includes/formChangePass.php | 1 + panel_user/includes/formDeleteAccount.php | 3 ++- register/includes/formRegister.php | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/assets/js/checkForms.js b/assets/js/checkForms.js index fc21fce..4ae73d4 100644 --- a/assets/js/checkForms.js +++ b/assets/js/checkForms.js @@ -21,6 +21,10 @@ $(document).ready(function() { $("#passValid").hide(); $("#passInvalid").hide(); $("#passWarning").hide(); + + //Iconos para validar que las contraseñas coindicen: + $("#repassValid").hide(); + $("#repassInvalid").hide(); //Comprueba que el nombre de usuario introducido para el login, exista. $("#name").change(function(){ @@ -66,6 +70,24 @@ $(document).ready(function() { }); + //Comprueba que las contraseñas sean iguales. + $("#repass").change(function(){ + const fieldPass = $("#new_pass"); + const fieldRepass = $("#repass"); + fieldRepass[0].setCustomValidity(""); + + if (Object.is(fieldPass.val(), fieldRepass.val())) { + $("#repassValid").show(); + $("#repassInvalid").hide(); + fieldRepass[0].setCustomValidity(""); + } else { + $("#repassValid").hide(); + $("#repassInvalid").show(); + fieldRepass[0].setCustomValidity("Las contraseñas deben coincidir."); + } + + }); + //Muestra si el nombre de usuario introducido para el login existe o no. function userLoginCheck(data, status) { const fieldLogin = $("#name"); diff --git a/panel_user/includes/formChangePass.php b/panel_user/includes/formChangePass.php index c7e3bfb..ad4e1bd 100644 --- a/panel_user/includes/formChangePass.php +++ b/panel_user/includes/formChangePass.php @@ -26,6 +26,7 @@ class FormChangePass extends Form {
".$errorPassword."✔⚠❌
".$errorPassword2."+ ✔❌
".$errorNombre."
".$errorEmail."-
".$errorPassword."+
".$errorPassword."
".$errorPassword2."+ ✔❌
".$errorPassword."✔⚠❌
".$errorPassword2."+ ✔❌