Update validation with select library
Opened this issue · 1 comments
kevinkashou commented
Hello,
I’m trying to figure out if there’s some sort of settings I need to update if I’m using a library for select box to make sure validation is remove if it passed the criteria. Is there ? Pristine validates when the value of select is empty but when I go go to select a value it doesn’t update as pass.
I am using choices js https://github.com/jshjohnson/Choices
Thank you!!
kevinkashou commented
I ended up doing this code
const select = document.querySelectorAll('.form-field--select');
select.forEach((item) => {
item.addEventListener('change', (event) => {
pristine.validate(document.getElementById(item.getAttribute('id') as any));
});
});