drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.39k stars 1.63k forks source link

formvalidation.io compatibility #372

Closed lolingz02 closed 7 years ago

lolingz02 commented 7 years ago

Hi

i have an issue with regards to resetting the form. im using $('formId').data('formValidation').resetForm(true); method to reset all the validations. problem is if there is an icheck inside the form, the icheck doesnt reset. thanks!

lolingz02 commented 7 years ago

found a workaround. i edited the formValidation.js plugin. looked for the resetField object and edited this line of code.

"radio" === i || "checkbox" === i ? $(e).prop("checked", !1).removeAttr("selected") : e.val("") to "radio" === i || "checkbox" === i ? $(e).prop("checked", !1).removeAttr("selected").icheck('unchecked') : e.val("").change()

Works fine. The e.val("").change() was meant for select2 to reset.