Menu

#97 poll option labels

open
nobody
None
3
2004-03-22
2004-03-16
No

Can we get some <label> tags on the text labels next to
the poll options? These have a couple of advantages.
First off, when used properly, it makes it possible to
click on the text and have the appropriate radio box
checked. This is just more user friendly and easier to
work with, since you don't have to target that tiny
little radio box.

Second, it is better for users with accessibility tools
like screen readers, since the software can then
intelligently group the form controls with the labels,
resulting in much better feedback to the user.

The label tags can be used with other form elements as
well, such as in the (meta-) moderation system,
post/reply form, preferences, etc.

To use a <label> tag, you need an id attribute on the
form element, and a match for attribute in the label
tag. i.e.

<input type="radio" name="poll" value="1" id="poll_1">
<label for="poll_1">I don't need accessibility
tools</label>
<input type="radio" name="poll" value="2" id="poll_2">
<label for="poll_2">I hate accessibility, it makes
coding so much harder</label>
<input type="radio" name="poll" value="3" id="poll_3">
<label for="poll_3">I use, but don't really need,
accessibility tools</label>
<input type="radio" name="poll" value="4" id="poll_4">
<label for="poll_4">I need accessibility tools, you
inconsiderate clod!</label>

Discussion

  • Peter Winnberg

    Peter Winnberg - 2004-03-21

    Logged In: YES
    user_id=355

    <label> is not part of HTML 3.2. This will be fixed if /
    when we get HTML 4.01 / XHTML 1.x templates.

     
  • Rob Malda

    Rob Malda - 2004-03-22
    • priority: 5 --> 3
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.