renvrant / conditionize.js

Small jQuery plugins for handling conditional form fields via data attributes. Unmaintained.
MIT License
53 stars 30 forks source link

data-condition isn't satisfied but field is shown #14

Closed dany1nueve closed 6 years ago

dany1nueve commented 6 years ago

Hi everyone,

I'm getting a little issue with conditionize.flexible.jquery.js

I have a field named email, and other field below with data-condition=email != '' This works fine but I have a JS function which remove invalid values from email, so if I put an invalid value in email field, the other field is shown but the email field is ''.

I think the condition is not checked again after JS function is executed.

Someone knows how to solve this?

rguliev commented 6 years ago

Hello, I would recommend to try trigger change at the end of your JS function which remove invalid values from email, i.e. try this

myEmailValidatorFunction(){
// There your validation
$('#my_email_input').trigger('change');
}
rguliev commented 6 years ago

@MaRVaOnDzZ, Did that work for you? I'm closing the issue since it seems like problem is out of the conditionize.flexible.jquery.js.