2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-02 16:04:07 +03:00

Lint docs js too and use `strict consistently. (#24160)

This commit is contained in:
XhmikosR
2017-09-28 17:25:28 +03:00
committed by GitHub
parent fe06814f3e
commit 502ac7ee4d
9 changed files with 41 additions and 21 deletions
+8 -7
View File
@@ -739,18 +739,19 @@ When attempting to submit, you'll see the `:invalid` and `:valid` styles applied
<script>
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function() {
"use strict";
window.addEventListener("load", function() {
var form = document.getElementById("needs-validation");
form.addEventListener("submit", function(event) {
if (form.checkValidity() == false) {
'use strict';
window.addEventListener('load', function() {
var form = document.getElementById('needs-validation');
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add("was-validated");
form.classList.add('was-validated');
}, false);
}, false);
}());
})();
</script>
{% endexample %}