Unable to have label tags without a "for" attribute in form widgets
|Reported by:||Owned by:||Sergey Kolosov|
|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
<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)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Accepted|
comment:7 Changed 3 years ago by
|Owner:||changed from nobody to Sergey Kolosov|
|Status:||new → assigned|
comment:9 Changed 3 years ago by
|Triage Stage:||Accepted → Ready for checkin|