CORRECCIONES - ALTA DE AGENCIAS - ADMINISTRADOR
This commit is contained in:
@@ -199,7 +199,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Registro de Agencia
|
||||
// Registro de Agencia
|
||||
document.getElementById('formAltaAgencias').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -280,7 +280,17 @@
|
||||
}
|
||||
// Si todas las validaciones pasan, el formulario se envía.
|
||||
this.submit();
|
||||
|
||||
// Validación del formulario
|
||||
let isValid = true;
|
||||
inputs.forEach(input => {
|
||||
if (!input.checkValidity()) {
|
||||
input.classList.add('shake');
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Script para manejar las animaciones de validación
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const inputs = document.querySelectorAll('.form-control');
|
||||
@@ -304,30 +314,6 @@
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
|
||||
// Validación del formulario
|
||||
document.getElementById('formAltaAgencias').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let isValid = true;
|
||||
inputs.forEach(input => {
|
||||
if (!input.checkValidity()) {
|
||||
input.classList.add('shake');
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
|
||||
if (isValid) {
|
||||
// Aquí puedes agregar tu lógica de envío
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: '¡Éxito!',
|
||||
text: 'Agencia registrada correctamente',
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -335,7 +321,7 @@
|
||||
<script>
|
||||
<?php if ($_GET['success'] === 'created'): ?>
|
||||
Swal.fire({ icon: 'success', title: 'Agencia registrada',
|
||||
text: 'La agencia adunal se ha registrada correctamente y se ha enviado un correo con las credenciales de acceso al administrador.',
|
||||
text: 'La agencia aduanal se ha registrada correctamente y se ha enviado un correo con las credenciales de acceso al administrador.',
|
||||
confirmButtonColor: '#198754' });
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user