drgullin / icheck

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

Input nested in table <td> element cannot be serialized/posted #119

Closed antoniofrignani closed 10 years ago

antoniofrignani commented 10 years ago

I am trying to POST checkboxes nested in a <td> element. While it seems that iCheck can't properly get this, if i remove the plugin everything works fine.

Here is a fiddle: http://codepen.io/antoniofrignani/pen/xEIGH

I can confirm this strange behaviour in Chrome (latest and canary) and Firefox (latest)

drgullin commented 10 years ago

This looks like an issue, I'm not sure why it doesn't work.

I'll push an updated 2.x version tomorrow, you may wait and try to use it instead. Your example will be tested.

drgullin commented 10 years ago

Btw, try to use this code:

$checkAll.on('ifChecked ifUnchecked', function(event) {
if (event.type == 'ifChecked') {
  $checkboxes.iCheck('check');
} else {
  $checkboxes.iCheck('uncheck');
}
});
antoniofrignani commented 10 years ago

Nope, even calling the check and uncheck directly, the problem is still here. I tried setting various options on the icheck, all with no results. To make it work i have to completely remove the table elements, so i think this can be a nesting problem but don't know where to look. Hope you can manage to find what it is causing the issue.

EDIT: actually found a workaround: if i move the <form> element outside the table, it correctly serializes and post all the named checkboxes. Proof: http://codepen.io/antoniofrignani/pen/coude

drgullin commented 10 years ago

So it's not an iCheck issue.

You may also try to use 2.x version, it's much faster, especially, on a huge number of elements https://github.com/fronteed/iCheck/tree/2.x-beta

MattFiler commented 9 years ago

I'm also having this problem. I can get the value of the checkboxes and radios on the page before posting, but after posting I loose all data. My checkboxes are nested in td tags, but my radios aren't - and I'm getting no data from either. If I take out my nested checkboxes, my radios seem to work on post.

What's happening? I'm having to change my code completely to work around this!

And I know it's an iCheck issue because as soon as I disable it on my page the form works fine.