Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onclick events, related with the checkboxes, not work... #52

Closed
giovkanata opened this issue Jul 6, 2013 · 3 comments
Closed

onclick events, related with the checkboxes, not work... #52

giovkanata opened this issue Jul 6, 2013 · 3 comments

Comments

@giovkanata
Copy link

This is a great plugin I'm trying to implement on my little project (in local), but after some attempts (and after carefully read the relative docs) I would need a little help for a simple questions.
Following example is only for explaining purposes (really I've a hundred checkboxes on my form and all them are related to their "hidden div"), I've a simple "onclick" event on a checkbox (to shows/hides a div chained to it):
<input name="some_name" id="some_name" value="1" type="checkbox" onclick="if(this.checked) { jQuery('#hidden_div').slideToggle(800); } else { jQuery('#hidden_div').hide(400); }" />
When an user clicking the checkbox, the validation tool (for example) recognises the checkbox as "checked" but the onclick event doesn't fire.

To avoid to rebuilt all conditions in the "onclick" events it's possible to read dinamically all setted conditions to then fire them with a iCheck callback? (using for example: .attribute('onclick')?) or is a bad idea?.
I'm new on jQuery (I've started to study it only a few days ago) and any help will be really appreciate.

@drgullin
Copy link
Owner

drgullin commented Jul 6, 2013

You can use ifToggled callback instead:

$('input:checkbox').on('ifToggled', function() {
  // do something
});

https://github.com/fronteed/iCheck#callbacks

Next version will support click handler on inputs.

@drgullin drgullin closed this as completed Jul 6, 2013
@cdiazr
Copy link

cdiazr commented Apr 12, 2015

Hi, when is coming next version which will support click handler on inputs? I cannot to write code for each event click on differentes radio buttons. Only recognise one. Maybe a longer explanation on plugin's documentation with different examples of use for each callback could be awesome.

@smemamian
Copy link

using this library without support click handler maybe you'd find it dull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants