You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Pristine dynamically, so I have 2 forms on the same page, I loop them through the class and then dynamically initialise them with Pristine. But the last one always works and never the first. I think that maybe the last initilisation goes to svorascribing the previous ones.
var forms = document.getElementsByClassName('my-form');
for(let form of forms) {
var pristine = new Pristine(form);
form.addEventListener('submit', function(e) {
e.preventDefault();
// on this point works only the second one, the first one return always false,
// if I have only the first one in the page, it works
// So pristine.validate(); returns alwasys false for the first one
var valid = pristine.validate();
if(valid) {
.......
} //end-valid-if
}); //end-addEventListener
} //end-for
The text was updated successfully, but these errors were encountered:
I'm trying to use Pristine dynamically, so I have 2 forms on the same page, I loop them through the class and then dynamically initialise them with Pristine. But the last one always works and never the first. I think that maybe the last initilisation goes to svorascribing the previous ones.
The text was updated successfully, but these errors were encountered: