// Below is bootstrap 5.0 validation code. it select all fields including hidden one. What changes should i make in script to exclude hidden fields for validation.Fuente: https://getbootstrap.com/docs/5.0/forms/validation/
Ejemplo de JavaScript de inicio para deshabilitar el envío de formularios si hay campos no válidos
(function () { 'use strict' // Fetch all the forms we want to apply custom Bootstrap validation styles to var forms = document.querySelectorAll('.needs-validation') // Loop over them and prevent submission Array.prototype.slice.call(forms) .forEach(function (form) { form.addEventListener('submit', function (event) { if (!form.checkValidity()) { event.preventDefault() event.stopPropagation() } form.classList.add('was-validated') }, false) }) })()