Bloqueo de interacción
This commit is contained in:
@@ -92,9 +92,7 @@ include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
<label class="col-md-2 col-form-label">Clave:</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" name="clave" maxlength="8"
|
||||
class="form-control" value="<?= htmlspecialchars($datos['clave'] ?? '') ?>"
|
||||
onfocus="this.value=''" onblur="if(this.value=='') this.value='<?= htmlspecialchars($datos['clave'] ?? '') ?>'">
|
||||
<span id="error-clave" class="error-msg"></span>
|
||||
class="form-control" value="<?= htmlspecialchars($datos['clave'] ?? '') ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1"></div>
|
||||
@@ -110,14 +108,14 @@ include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-2 col-form-label">Nombre:</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" value="<?= htmlspecialchars($datos['nombre'] ?? '') ?>" readonly>
|
||||
<input type="text" class="form-control" value="<?= htmlspecialchars($datos['nombre'] ?? '') ?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-2 col-form-label">RFC:</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" value="<?= htmlspecialchars($datos['rfc'] ?? '') ?>" readonly>
|
||||
<input type="text" class="form-control" value="<?= htmlspecialchars($datos['rfc'] ?? '') ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1"></div>
|
||||
@@ -127,7 +125,6 @@ include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
<input type="text" name="curp" maxlength="18"
|
||||
class="form-control" value="<?= htmlspecialchars($datos['curp'] ?? '') ?>"
|
||||
onfocus="this.value=''" onblur="if(this.value=='') this.value='<?= htmlspecialchars($datos['curp'] ?? '') ?>'">
|
||||
<span id="error-curp" class="error-msg"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -206,7 +203,7 @@ include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-2 col-form-label">Teléfono:</label>
|
||||
<div class="col-md-5">
|
||||
<input type="text" class="form-control" value="<?= htmlspecialchars($datos['telefono'] ?? '') ?>" readonly>
|
||||
<input type="text" class="form-control" value="<?= htmlspecialchars($datos['telefono'] ?? '') ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1"></div>
|
||||
@@ -216,14 +213,13 @@ include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
<input type="text" name="fax" maxlength="12"
|
||||
class="form-control" value="<?= htmlspecialchars($datos['fax'] ?? '') ?>"
|
||||
onfocus="this.value=''" onblur="if(this.value=='') this.value='<?= htmlspecialchars($datos['fax'] ?? '') ?>'">
|
||||
<span id="error-fax" class="error-msg"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-2 col-form-label">Correo:</label>
|
||||
<div class="col-md-10">
|
||||
<input type="email" class="form-control" value="<?= htmlspecialchars($datos['correo'] ?? '') ?>" readonly>
|
||||
<input type="email" class="form-control" value="<?= htmlspecialchars($datos['correo'] ?? '') ?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -248,17 +244,11 @@ include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
document.getElementById('form-edicion').addEventListener('submit', function (event) {
|
||||
event.preventDefault(); // Evita que el formulario se envíe
|
||||
|
||||
const clave = document.querySelector('[name="clave"]').value.trim();
|
||||
const curp = document.querySelector('[name="curp"]').value.trim();
|
||||
const fax = document.querySelector('[name="fax"]').value.trim();
|
||||
|
||||
let errores = [];
|
||||
|
||||
// Validación Clave
|
||||
if (!/^[A-Z0-9]{8}$/.test(clave)) {
|
||||
errores.push('La clave debe tener exactamente 8 caracteres, solo letras mayúsculas y números.');
|
||||
}
|
||||
|
||||
// Validación CURP
|
||||
if (!/^[A-Z]{4}[0-9]{6}[HM](AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS)[A-Z]{3}[A-Z0-9]{2}$/.test(curp)) {
|
||||
errores.push('La CURP no tiene el formato correcto.');
|
||||
|
||||
Reference in New Issue
Block a user