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

Radio bugfix & returned value attribute value for checkable inputs. #2

Closed
wants to merge 3 commits into from
Closed

Conversation

jackmoore
Copy link
Owner

selected isn't an attribute of radio elements, they use checked just like checkboxes. Checkboxes and radios have a value attribute, so that attribute value should be returned instead of the checked state.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input

A radio button. You must use the value attribute to define the value submitted by this item. Use the checked attribute to indicate whether this item is selected by default.

`selected` isn't an attribute of radio elements, they use `checked` just like checkboxes. Checkboxes and radios have a value attribute, so that attribute value should be returned instead of the checked state.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input
> A radio button. You must use the value attribute to define the value submitted by this item. Use the checked attribute to indicate whether this item is selected by default.
I believe the only elements that the browser will recognize the disabled attribute for are input, textarea, select, and keygen.  Since you can't nest these elements inside of each other, there should be no need to check ancestor elements for disabled.
no dependencies needed.
@jonathanong
Copy link
Collaborator

oops. added on npm and added as collab.

also, the closest stuff is for fieldset[disabled]s

@jackmoore
Copy link
Owner Author

also, the closest stuff is for fieldset[disabled]

Good point, thanks.

@jackmoore
Copy link
Owner Author

Refactored in a different commit.

@jackmoore jackmoore closed this May 15, 2015
@jackmoore
Copy link
Owner Author

Thanks for adding as collaborator, let me know if you have any objections to the change.

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

Successfully merging this pull request may close these issues.

None yet

2 participants