From 50cfb0abf00db110f2dd30f3a9982f1925502787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 19 Feb 2014 09:52:04 -0500 Subject: [PATCH] Button: Improve accessibility for checkbox/radio buttons Fixes gh-185 --- entries/button.xml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/entries/button.xml b/entries/button.xml index b46d7749..6120b1dc 100644 --- a/entries/button.xml +++ b/entries/button.xml @@ -7,7 +7,7 @@

In addition to basic push buttons, radio buttons and checkboxes (inputs of type radio and checkbox) can be converted to buttons. Their associated label is styled to appear as the button, while the underlying input is updated on click. For the association to work properly, give the input an id attribute, and refer to that in the label's for attribute. Don't nest the input inside the label, as that causes accessibility problems.

-

In order to group radio buttons, Button also provides an additional widget, called Buttonset. Buttonset is used by selecting a container element (which contains the radio buttons) and calling .buttonset(). Buttonset will also provide visual grouping, and therefore should be used whenever you have a group of buttons. It works by selecting all descendants and applying .button() to them. You can enable and disable a button set, which will enable and disable all contained buttons. Destroying a button set also calls each button's destroy method.

+

In order to group radio buttons, Button also provides an additional widget, called Buttonset. Buttonset is used by selecting a container element (which contains the radio buttons) and calling .buttonset(). Buttonset will also provide visual grouping, and therefore should be used whenever you have a group of buttons. It works by selecting all descendants and applying .button() to them. You can enable and disable a button set, which will enable and disable all contained buttons. Destroying a button set also calls each button's destroy method. For grouped radio and checkbox buttons, it's recommended to use a fieldset with a legend to improve accessibility.

When using an input of type button, submit or reset, support is limited to plain text labels with no icons.

@@ -90,11 +90,21 @@ $( "button" ).button(); $( "#radio" ).buttonset(); ]]>