Unable to have label tags without a "for" attribute in form widgets
|Reported by:||Denis Martinez <deuns.martinez@…>||Owned by:||sergeykolosov|
|Severity:||Normal||Keywords:||forms label for none dceu13|
|Cc:||eromijn@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
(recaptcha_django in my case).
form.as_p() generates a label tag with an unmatched id: <label for="id_recaptcha"> .
This makes my page invalid in HTML5.
I tried to override id_for_label like this in my widget's code:
def id_for_label(self, id_): return None
which gives <label for="None"> .
Anyway, I believe that this case should be treated adequately, because the docstring
states that id_for_label can return None values.
Change History (12)
Changed 6 years ago by Denis Martinez <deuns.martinez@…>
comment:1 Changed 6 years ago by SmileyChris
- Needs documentation unset
- Needs tests set
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
Changed 5 years ago by DenisMartinez
comment:7 Changed 22 months ago by sergeykolosov
- Owner changed from nobody to sergeykolosov
- Status changed from new to assigned
comment:9 Changed 22 months ago by erikr
- Cc eromijn@… added
- Keywords dceu13 added
- Triage Stage changed from Accepted to Ready for checkin