Revisión 2.1
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="curp" class="form-label">CURP *</label>
|
||||
<input name="curp" id="curp" class="form-control" maxlength="18" required>
|
||||
<input name="curp" id="curp" class="form-control" maxlength="18">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="caat" class="form-label">Código CAAT *</label>
|
||||
<label for="caat" class="form-label">Código caat *</label>
|
||||
<input name="caat" id="caat" class="form-control" maxlength="20" required>
|
||||
</div>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
<div class="col-md-8">
|
||||
<label for="domicilio" class="form-label">Domicilio *</label>
|
||||
<input name="domicilio" id="domicilio" class="form-control" required>
|
||||
<input name="domicilio" id="domicilio" class="form-control" maxlength="100" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -123,7 +123,6 @@
|
||||
const curpRegex = /^[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}$/;
|
||||
const rfcRegex = /^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{3}$/;
|
||||
const telefonoRegex = /^\d{3}\s\d{7}$/;
|
||||
const soloNumerosRegex = /^[0-9]+$/;
|
||||
|
||||
// Validaciones de campos obligatorios
|
||||
if (!clave) {
|
||||
@@ -151,11 +150,6 @@
|
||||
document.getElementById('rfc').focus();
|
||||
return;
|
||||
}
|
||||
if (!curp) {
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'El CURP es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('curp').focus();
|
||||
return;
|
||||
}
|
||||
// Validación de CURP (solo si se ingresó)
|
||||
if (curp && !curpRegex.test(curp)) {
|
||||
Swal.fire({ icon: 'error', title: 'CURP inválido', text: 'El CURP no tiene el formato correcto.', confirmButtonColor: '#dc3545'
|
||||
@@ -179,12 +173,7 @@
|
||||
return;
|
||||
}
|
||||
if (!caat) {
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'El código CAAT es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('caat').focus();
|
||||
return;
|
||||
}
|
||||
if (!soloNumerosRegex.test(caat)) {
|
||||
Swal.fire({ icon: 'error', title: 'Código CAAT inválido', text: 'El código caat solo puede contener números.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({ icon: 'error', title: 'Campo requerido', text: 'El código caat es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('caat').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user