您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819
  1. // Example starter JavaScript for disabling form submissions if there are invalid fields
  2. (function() {
  3. 'use strict';
  4. window.addEventListener('load', function() {
  5. // Fetch all the forms we want to apply custom Bootstrap validation styles to
  6. var forms = document.getElementsByClassName('needs-validation');
  7. // Loop over them and prevent submission
  8. var validation = Array.prototype.filter.call(forms, function(form) {
  9. form.addEventListener('submit', function(event) {
  10. if (form.checkValidity() === false) {
  11. event.preventDefault();
  12. event.stopPropagation();
  13. }
  14. form.classList.add('was-validated');
  15. }, false);
  16. });
  17. }, false);
  18. })();