Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

valid always return true! #73

Open
rejoan121615 opened this issue Jul 22, 2021 · 0 comments
Open

valid always return true! #73

rejoan121615 opened this issue Jul 22, 2021 · 0 comments

Comments

@rejoan121615
Copy link

rejoan121615 commented Jul 22, 2021

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);
});

};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant