definicao de layout
This commit is contained in:
16
public/assets/js/form-validation-custom.js
Normal file
16
public/assets/js/form-validation-custom.js
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
(function() {
|
||||
'use strict';
|
||||
window.addEventListener('load', function() {
|
||||
var forms = document.getElementsByClassName('needs-validation');
|
||||
var validation = Array.prototype.filter.call(forms, function(form) {
|
||||
form.addEventListener('submit', function(event) {
|
||||
if (form.checkValidity() === false) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add('was-validated');
|
||||
}, false);
|
||||
});
|
||||
}, false);
|
||||
})();
|
||||
Reference in New Issue
Block a user