/* * @copyright 2022 beikeshop.com - All Rights Reserved. * @link https://beikeshop.com * @Author pu shuo * @Date 2022-08-17 15:42:46 * @LastEditTime 2022-09-16 20:57:54 */ // Example starter JavaScript for disabling form submissions if there are invalid fields $(function () { 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 ); }); });