Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8800143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:30:34+00:00 2026-06-14T00:30:34+00:00

Does the label tag work with radio buttons? If so, how do you use

  • 0

Does the label tag work with radio buttons? If so, how do you use it? I have a form that displays like this:

First Name: (text field)
Hair Color: (color drop-down)
Description: (text area)
Salutation: (radio buttons for Mr., Mrs., Miss)

I’d like to use the label tag for each label in the left column to define its connection to the appropriate control in the right column. But If I use a radio button, the spec seems to indicate that suddenly the actual “Salutation” label for the form control no longer belongs in the label tag, but rather the options “Mr., Mrs., etc.” go in the label tag.

I’ve always been a fan of accessibility and the semantic web, but this design doesn’t make sense to me. The label tag explicitly declares labels. The option tag selection options. How do you declare a label on the actual label for a set of radio buttons?

UPDATE:
Here is an example with code:

<tr><th><label for"sc">Status:</label></th>
    <td>&#160;</td>
    <td><select name="statusCode" id="sc">
            <option value="ON_TIME">On Time</option>
            <option value="LATE">Late</option>
        </select></td></tr>

This works great. But unlike other form controls, radio buttons have a separate field for each value:

<tr><th align="right"><label for="???">Activity:</label></th>
    <td>&#160;</td>
    <td align="left"><input type="radio" name="es" value="" id="es0" /> Active &#160;
        <input type="radio" name="es" value="ON_TIME" checked="checked" id="es1" /> Completed on Time &#160;
        <input type="radio" name="es" value="LATE" id="es2" /> Completed Late &#160;
        <input type="radio" name="es" value="CANCELED" id="es3" /> Canceled</td>
</tr>

What to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:30:35+00:00Added an answer on June 14, 2026 at 12:30 am

    Does the label tag work with radio buttons?

    Yes

    If so, how do you use it?

    Same way as for any other form control.

    You either give it a for attribute that matches the id of the control, or you put the control inside the label element.

    I’d like to use the label tag for each label in the left column

    A label is for a control, not a set of controls.

    If you want to caption a set of controls, use a <fieldset> with a <legend> (and give a <label> to each control in the set).

    <fieldset>
      <legend> Salutation </legend>
      <label> <input type="radio" name="salutation" value="Mr."> Mr. </label>
      <label> <input type="radio" name="salutation" value="Mrs."> Mrs. </label>
      <!-- etc -->
    </fieldset>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, I have a code segment here: <div class=label><%= f.label :course %> <span>(Does this
I have an < mx:Label > tag that has a set width, which is
A label tag is of the form: <label for=id_of_text_field> <input type=text name=example id=id_of_text_field />
Does the <label/> tag need to be closed in html5 doctype?
Why does this compile? If Months > 1 Then Label.Text = Months + Months
On my page, I have a dynamically generated list of radio buttons (created with
Richfaces 3.3.3, Jsf 1.2: I have a a4j:form that uses some simple validation, mainly
Does a button with a value really need a matching label tag in order
Demoed here: http://jsfiddle.net/dRtaR/2/ The label option of the Jquery UI button does not work.
I have a Tag collection, they only have one value which is the label.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.