diff --git a/index.php b/index.php
index a01fcc6..913490d 100644
--- a/index.php
+++ b/index.php
@@ -662,12 +662,12 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489";
@@ -897,17 +897,34 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489";
const message = document.getElementById('user-message').value.trim();
const phoneRegex = /^\+?[0-9]{7,15}$/;
- if (!name || !phone) {
- alert('Por favor, ingresa tu nombre y número de móvil para continuar.');
+ if (name.length < 3) {
+ alert('Por favor, ingresa un nombre válido (mínimo 3 caracteres).');
+ document.getElementById('user-name').style.borderColor = '#ff4444';
+ return;
+ }
+
+ if (!phone) {
+ alert('Por favor, ingresa tu número de móvil para continuar.');
+ document.getElementById('user-phone').style.borderColor = '#ff4444';
return;
}
if (!phoneRegex.test(phone.replace(/\s/g, ''))) {
alert('Por favor, ingresa un número de móvil válido (ej: +5359177041).');
+ document.getElementById('user-phone').style.borderColor = '#ff4444';
return;
}
- const text = `Hola, soy ${name} (${phone}). Quiero escuchar: ${message}`;
+ const now = new Date();
+ const dateTime = now.toLocaleDateString() + ' ' + now.toLocaleTimeString();
+ const refId = Math.floor(1000 + Math.random() * 9000);
+
+ const text = `*PETICIÓN RADIO* (Ref: #${refId})\n\n` +
+ `*Nombre:* ${name}\n` +
+ `*Móvil:* ${phone}\n` +
+ `*Fecha:* ${dateTime}\n\n` +
+ `*Mensaje:* ${message || 'Sin mensaje específico'}`;
+
const url = `https://wa.me/= str_replace('+', '', $whatsapp_number) ?>?text=${encodeURIComponent(text)}`;
window.open(url, '_blank');
}
@@ -956,13 +973,21 @@ $facebook_link = "https://www.facebook.com/profile.php?id=61587890927489";
const message = chatMsg.value.trim();
const phoneRegex = /^\+?[0-9]{7,15}$/;
- if (!user || !phone) {
- alert('Por favor, regístrate con tu nombre y móvil arriba para poder chatear.');
+ if (user.length < 3) {
+ alert('Por favor, ingresa un nombre válido arriba (mínimo 3 caracteres).');
+ userNameInput.style.borderColor = '#ff4444';
+ return;
+ }
+
+ if (!phone) {
+ alert('Por favor, regístrate con tu móvil arriba para poder chatear.');
+ userPhoneInput.style.borderColor = '#ff4444';
return;
}
if (!phoneRegex.test(phone.replace(/\s/g, ''))) {
alert('Por favor, ingresa un número de móvil válido arriba.');
+ userPhoneInput.style.borderColor = '#ff4444';
return;
}