RadioSelect Widget : Incorrect/Wrong Mark-up?
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?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home