Skip to content

The radio button and checkbox examples should show how to create accessible group names #185

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

Closed
dylanb opened this issue Oct 27, 2013 · 1 comment

Comments

@dylanb
Copy link

dylanb commented Oct 27, 2013

The current examples for radio button and checkbox groupings do not show how to create accessible group labels.

Ideally, the radio button would not allow you to create it without a group label (because this is always an accessibility problem), however, in lieu of that, we should show these examples ONLY with group labels and also document the accessibility requirement for them.

Radio button example markup can be changed to the following

<form>
    <fieldset>
        <legend>Group Name</legend>
        <div id="radio">
            <input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1</label>
            <input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2</label>
            <input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
        </div>
    </fieldset>
</form>

The checkbox markup can be changed to the following

    <fieldset>
        <legend>Group Name</legend>
        <div id="format">
            <input type="checkbox" id="check1" /><label for="check1">B</label>
            <input type="checkbox" id="check2" /><label for="check2">I</label>
            <input type="checkbox" id="check3" /><label for="check3">U</label>
        </div>
    </fieldset>
@jzaefferer
Copy link
Member

@arschmitz how is the button rewrite going to affect this?

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

No branches or pull requests

2 participants