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

Reset Validation #44

Closed
alfredtech opened this issue Jul 22, 2017 · 1 comment
Closed

Reset Validation #44

alfredtech opened this issue Jul 22, 2017 · 1 comment

Comments

@alfredtech
Copy link

Hi, I'm using your validator to validate my form inside a modal bootstrap. I use the same form for CRUD. but the thing is when i close the modal, the validator didn't reset the validation. it stuck there and when i open the popup for view / update, the validation is still there.

how to reset the validator?

thanks
Jan

@yairEO yairEO closed this as completed in a476570 Nov 20, 2017
@yairEO
Copy link
Owner

yairEO commented Nov 20, 2017

Here's an example how to reset the validator on form reset event:

var validator = new FormValidator( document.forms[0] ); // the form element is passed as an argument, but it's not a must, since it can be passed directly in the `reset` method as well

// on form "reset" event
document.forms[0].onreset = function(e){
    validator.reset(); 
};

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

2 participants