Disable icheck in a checkbox

Asked

Viewed 263 times

1

Guys I’m using the icheck plugin to customize my page checkboxes. I have some checkboxes in a form and I would like the icheck to work only in the checkbox that has the class with the name icheck and the others to be in the original form. You can do this?

Thank you

  • Provide an example of what you’ve already done, including jquery and plugin using Stacksnippet. :)

  • Yes, has.

  • @Thank you, but the interesting thing is the AP form a good question with example to arouse interest of other users and also avoid problem in understanding the issue chance the link breaks. I can say that you and I could have answered the question easily, but in my view the question has to be "good" to aggregate the community. Another detail, there are many plugins with repeated names, put only the name as the AP did is not cool. :)

  • @Guilhermenascimento why it was posted as a comment, and not as a response.

  • @Renan A yes, thank you. I just wanted to say that at this point it is best to encourage the questioner to provide relevant details :) See you more.

1 answer

1


It is possible yes. To start the icheck in one or more fields it is done through jQuery selectors. An example to apply the icheck to all checkboxes and radios with the blue theme would be like this:

$('input[type="checkbox"], input[type="radio"]').iCheck({
    checkboxClass: 'icheckbox_square-blue',
    radioClass: 'iradio_square-blue'
 });

To select only checkboxes and radios with the icheck class just include your class in the selector. For example:

$('input[type="checkbox"].icheck, input[type="radio"].icheck').iCheck({
    checkboxClass: 'icheckbox_square-blue',
    radioClass: 'iradio_square-blue'
 });
  • Thank you. That was it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.