#3101 closed defect (fixed)
newforms produces invalid XHTML with hidden fields
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | minor | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Based on the unit tests around line 1769 in source:/django/trunk/tests/regressiontests/forms/tests.py Django's newforms produce invalid XHTML.
The only elements allowed under a <table> tag are <thead>, <tbody>, and <tr>.
I am unsure of a concrete solution to this. If the hidden field isn't the last field, rendering can be delayed until the next rendered <td> tag (the next label). In the case that the hidden fields are last, perhaps insert them at the end of the last <td> rendered or render an empty row, although that is less-than-ideal.
Change History (3)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Good catch. I'd assumed it would be valid XHTML, but I guess not. :-/
I guess rendering could either be delayed for the next
<td>, or we could save all the hidden fields and render them all together at the bottom of the form. Hmm...