Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-20 17:01:22 +02:00 committed by GitHub
parent fa4769d77b
commit 038de91627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 1 deletions

View File

@ -22,6 +22,10 @@ $(document).ready(function() {
$("#passInvalid").hide(); $("#passInvalid").hide();
$("#passWarning").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. //Comprueba que el nombre de usuario introducido para el login, exista.
$("#name").change(function(){ $("#name").change(function(){
var url = "../assets/php/common/checkUser.php?user=" + $("#name").val(); var url = "../assets/php/common/checkUser.php?user=" + $("#name").val();
@ -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. //Muestra si el nombre de usuario introducido para el login existe o no.
function userLoginCheck(data, status) { function userLoginCheck(data, status) {
const fieldLogin = $("#name"); const fieldLogin = $("#name");

View File

@ -26,6 +26,7 @@ class FormChangePass extends Form {
<input type='password' name='new_pass' id='new_pass' value='' placeholder='Nueva Contraseña' required/><pre>".$errorPassword."</pre> <input type='password' name='new_pass' id='new_pass' value='' placeholder='Nueva Contraseña' required/><pre>".$errorPassword."</pre>
<span id='passValid'>&#x2714;</span><span id='passWarning'>&#x26a0;</span></span><span id='passInvalid'>&#x274C;</span> <span id='passValid'>&#x2714;</span><span id='passWarning'>&#x26a0;</span></span><span id='passInvalid'>&#x274C;</span>
<input type='password' name='repass' id='repass' value='' placeholder='Repita la nueva contraseña' required/><pre>".$errorPassword2."</pre> <input type='password' name='repass' id='repass' value='' placeholder='Repita la nueva contraseña' required/><pre>".$errorPassword2."</pre>
<span id='repassValid'>&#x2714;</span></span><span id='repassInvalid'>&#x274C;</span>
</fieldset> </fieldset>
<div class='actions'> <div class='actions'>
<input type='submit' id='submit' value='Cambiar Contraseña' class='primary' /> <input type='submit' id='submit' value='Cambiar Contraseña' class='primary' />

View File

@ -27,8 +27,9 @@ class FormDeleteAccount extends Form {
<legend>Datos de la cuenta</legend> <legend>Datos de la cuenta</legend>
<input type='text' name='name' id='name' value='' placeholder='Nombre de usuario' required/><pre>".$errorNombre."</pre> <input type='text' name='name' id='name' value='' placeholder='Nombre de usuario' required/><pre>".$errorNombre."</pre>
<input type='text' name='email' id='email' value='' placeholder='Email de usuario' required/><pre>".$errorEmail."</pre> <input type='text' name='email' id='email' value='' placeholder='Email de usuario' required/><pre>".$errorEmail."</pre>
<input type='password' name='pass' id='pass' value='' placeholder='Contraseña' required/><pre>".$errorPassword."</pre> <input type='password' name='pass' id='new_pass' value='' placeholder='Contraseña' required/><pre>".$errorPassword."</pre>
<input type='password' name='repass' id='repass' value='' placeholder='Repita la contraseña' required/><pre>".$errorPassword2."</pre> <input type='password' name='repass' id='repass' value='' placeholder='Repita la contraseña' required/><pre>".$errorPassword2."</pre>
<span id='repassValid'>&#x2714;</span></span><span id='repassInvalid'>&#x274C;</span>
</fieldset> </fieldset>
<div class='verify'> <div class='verify'>
<input type='checkbox' id='checkbox' name='verify' required> <input type='checkbox' id='checkbox' name='verify' required>

View File

@ -38,6 +38,7 @@ class FormRegister extends Form {
<input type='password' name='new_pass' id='new_pass' value='' placeholder='Contraseña' required/><pre>".$errorPassword."</pre> <input type='password' name='new_pass' id='new_pass' value='' placeholder='Contraseña' required/><pre>".$errorPassword."</pre>
<span id='passValid'>&#x2714;</span><span id='passWarning'>&#x26a0;</span></span><span id='passInvalid'>&#x274C;</span> <span id='passValid'>&#x2714;</span><span id='passWarning'>&#x26a0;</span></span><span id='passInvalid'>&#x274C;</span>
<input type='password' name='repass' id='repass' value='' placeholder='Repita la contraseña' required/><pre>".$errorPassword2."</pre> <input type='password' name='repass' id='repass' value='' placeholder='Repita la contraseña' required/><pre>".$errorPassword2."</pre>
<span id='repassValid'>&#x2714;</span></span><span id='repassInvalid'>&#x274C;</span>
</fieldset> </fieldset>
<div class='verify'> <div class='verify'>
<input type='checkbox' id='checkbox' name='terms' required> <input type='checkbox' id='checkbox' name='terms' required>