Question

I have a form with a group of 4 radio buttons and for some reason unknown to me, my fourth radio does not work...

JSBIN here: radio madness

I ran the code through the W3C validator and it complains that on the 4th radio the label element must refer to a form input.

Looking at my 3rd and 4th radio labels and input...

    <label for="dyno_fe7ee1e9-6005-69e7-6205-5265c866f79f_content_type_2">Structured Text</label>
    <input type="radio" id="dyno_fe7ee1e9-6005-69e7-6205-5265c866f79f_content_type_2" name="dyno_fe7ee1e9-6005-69e7-6205-5265c866f79f_content_type" value="text/structured">

This works, while this:

    <label for="dyno_fe7ee1e9-6005-69e7-6205-5265c866fa79f_content_type_3" data-i18n="">reStructuredText</label>
    <input type="radio" id="dyno_fe7ee1e9-6005-69e7-620a5-5265c866f79f_content_type_3"  name="dyno_fe7ee1e9-6005-69e7-6205-5265c866f79f_content_type" value="text/x-rst">

fails. It must be something related to the id-attribute because if I just use a, b, c as id, the code passes. I have looked up id limits and it cannot be a length issue, plus I'm starting with a character, so for me it's ok.

Question:
Why is the id attribute of the 4th radio button invalid, when the other three are working ok?

Thanks for enlightenment...

Était-ce utile?

La solution

They're not the same, so your label doesn't refer to a form element...

                                 **
for: dyno_fe7ee1e9-6005-69e7-6205-5265c866fa79f_content_type_3
id:  dyno_fe7ee1e9-6005-69e7-620a5-5265c866f79f_content_type_3
                                 **
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top