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

Issue #23 Part - Loses "checked" state #24

Closed
timothymarois opened this issue Apr 29, 2013 · 4 comments
Closed

Issue #23 Part - Loses "checked" state #24

timothymarois opened this issue Apr 29, 2013 · 4 comments
Labels

Comments

@timothymarois
Copy link

The issue #23 was resolved, but it caused another issue within. or partly fixed. When something is "checked" on the page load. and you have multiple forms (described in #23), if you move a radio button to another option, the other forms will remove their "checked" states

<form id="form1">
<input type="radio" name="test1" checked>
<input type="radio" name="test2">
</form>
<form id="form2 ">
<input type="radio" name="test1" checked>
<input type="radio" name="test2">
</form>

Example: if I change the radio option on form1 and go look at form2, the "checked" state is lost.

(thank you for fixes the previous issue so quickly)

@timothymarois
Copy link
Author

I'd like to confirm with further testing that I'm seeing #23 present again and doesn't appear to be fully resolved. I tested again, and notice it has worked a few times, but reloading and replicating it over and over, I still see the data being lost to the form.

@drgullin
Copy link
Owner

This may happen if you don't use unique ids.

Clicking works on a checkboxes, but not on labels with the same for attribute.
Since id attribute should be unique and is used to bind labels to inputs, iCheck works in an expected way.
It just toggles inputs using a given id (for="id").

@timothymarois
Copy link
Author

What do you recommended? I just tested adding a unique id to input with a for=id to labels. And had the same results if the id's weren't present.

@drgullin
Copy link
Owner

Since grouped radio buttons should share the same name attribute, your code doesn't work.

This code works:

<input type="radio" name="test1" checked>
<input type="radio" name="test1">

Issue #23 is fixed http://jsfiddle.net/b2UwH/

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

No branches or pull requests

2 participants