Surfin’ Safari

The New Form Controls: Radio Buttons

Posted by Dave Hyatt on Wednesday, August 10th, 2005 at 3:38 pm

The new radio buttons are now enabled (along with checkboxes) in the latest WebKit builds. Radio buttons behave as checkboxes do, meaning that they wont respond to properties like background-image or border until you disable the -khtml-appearance property. Once you do, you’ll get a completely blank slate and can define how all the states of the control should look.

I also did some cleanup on radio buttons to make them more consistent with WinIE and with OS X as far as keyboard navigation goes. The radio group is now a single item as far as tabbing is concerned, and the arrow keys can now be used to navigate within the radio group itself.

6 Responses to “The New Form Controls: Radio Buttons”

  1. Dustin Says:

    Any chance you could post up some funky images for us plebes to view?

  2. Karl Benson Says:

    I’m glad that support for this is being checked in. In order to help people see what everything looks like, I’ve created a simple test page. This page will be updated as support for more form controls is added.

  3. hyatt Says:

    :checked works just fine on radio buttons, Karl. Unnamed radio buttons don’t belong to a group and therefore do not check. This change was made along with the other fixes to radio buttons to be more consistent with WinIE (which also does not allow a group-less radio button to check). Put the radio buttons in a group by adding name=”mygroup” to all of them, and then they’ll work.

  4. Chris Clark Says:

    Fantastic news about the fixed keyboard nav. Throw in input/label pair clicking to bring *that* into line with the rest of the OS/other browsers and I might just burst :)

  5. Karl Benson Says:

    Thanks for the information, Dave. The test has been updated accordingly.

  6. Darth Ed Says:

    Dave, will you be working on improving Safari’s support for tags be soon? I hope so! Form accessibility suffers without being able to click on checkbox and radio button labels especially.

    http://bugzilla.opendarwin.org/show_bug.cgi?id=3244