On Tue, Mar 2, 2010 at 5:05 PM, Prabhu <prabhu.subraman...@gmail.com> wrote:
> I think the browser would forgive for these mistakes. See if you can
> file a bug and submit a patch to django.
>
> On Mar 1, 2:03 am, "czamb...@gmail.com" <czamb...@gmail.com> wrote:
>> It looks like the mark-up used for the RadioSelect widget is
>> incorrect.
>>
>> For example:
>> from django import forms
>> class PersonForm(forms.Form):
>>     GENDER_OPTIONS = (
>>         ('M','Male'),
>>         ('F','Female'),
>>         )
>>     gender =
>> forms.ChoiceField(widget=forms.RadioSelect(),choices=GENDER_OPTIONS,
>> label="I am")>>> form = PersonForm()
>> >>> print form.as_p()
>>
>> <p><label for="id_gender_0">I am:</label> <ul>
>> <li><label for="id_gender_0"><input type="radio" id="id_gender_0"
>> value="M" name="gender" /> Male</label></li>
>> <li><label for="id_gender_1"><input type="radio" id="id_gender_1"
>> value="F" name="gender" /> Female</label></li>
>> </ul></p>
>>
>> Notice how the label contains the input, radio, field. Shouldn't the
>> mark-up be the following:
>>
>> <p><label for="id_gender_0">I am:</label> <ul>
>> <li><label for="id_gender_0">Male</label><input type="radio"
>> id="id_gender_0" value="M" name="gender" /> </li>
>> <li><label for="id_gender_1">Female</label><input type="radio"
>> id="id_gender_1" value="F" name="gender" /></li>
>> </ul></p>
>>
>> Am I missing something?
>

Looks like you are both missing a read of section 17.9.1 [1] of the
HTML 4 spec. This is entirely valid HTML.

Cheers

Tom

[1] 
http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#idx-label-1

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to