Pristine icon indicating copy to clipboard operation
Pristine copied to clipboard

Update validation with select library

Open kevinkashou opened this issue 5 years ago • 1 comments

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 avatar Apr 25 '19 05:04 kevinkashou

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

kevinkashou avatar Apr 26 '19 04:04 kevinkashou