valid always return true!
Opened this issue · 0 comments
rejoan121615 commented
I just copy the code and replace the form id with my form id. But the valid variable always returns true. It's doesn't return any error or anything.
// pristine validation
window.onload = function () {
var form = document.getElementById("sign-in");
// create the pristine instance
var pristine = new Pristine(form);
form.addEventListener("submit", function (e) {
e.preventDefault();
// check if the form is valid
var valid = pristine.validate(); // returns true or false
console.log(valid);
console.log(pristine);
});
};