-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
35 lines (28 loc) · 1.38 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Simulación de envío de datos y verificación
document.getElementById("registerForm").addEventListener("submit", function (e) {
e.preventDefault();
const email = document.getElementById("email").value;
const password = document.getElementById("password").value;
const statusMessage = document.getElementById("statusMessage");
// Validar campos vacíos
if (!email || !password) {
statusMessage.textContent = "Por favor, completa todos los campos.";
statusMessage.style.color = "red";
return;
}
// Mostrar mensaje de registro
statusMessage.textContent = "Registrando usuario...";
statusMessage.style.color = "yellow";
// Simular registro y envío de notificaciones
setTimeout(() => {
// Código de verificación simulado
const verificationCode = Math.floor(100000 + Math.random() * 900000);
// Simulación de envío de notificación al administrador
console.log(`Notificación al administrador: Nuevo usuario registrado - ${email}`);
// Simulación de envío del código al usuario
console.log(`Código de verificación enviado a ${email}: ${verificationCode}`);
// Mostrar mensaje final
statusMessage.textContent = `Usuario registrado exitosamente. Código de verificación enviado a ${email}`;
statusMessage.style.color = "green";
}, 2000);
});