I want to use validation on a date field (seguro_resp_civil_validade). This field only needs to be validated when the bootstrap switch (seguro_resp_civil) is "ON".
I have this piece of code:
seguro_resp_civil_validade: {
required: { depends: function(element){ return $("#seguro_resp_civil").hasClass("checked") } }
},
This is not working, maybe because I'm using a bootstrap-switch and the 'hasClass' is not correct for this use. How can I check if the bootstrap-switch is checked?
Thanks