Add "required" & "error" CSS classes to form rows in as_* methods
|Reported by:||Waylan Limberg <waylan@…>||Owned by:||nobody|
|Cc:||waylan@…, real.human@…, gonz, liangent@…, andy@…, drackett@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||no||Patch needs improvement:||no|
Currently, there is no way to identify which fields have errors or are required with CSS. The patch below adds HTML classes to the containing block element for that purpose.
Therefore, using as_tr(), a field that is both required and contains an error would begin like so:
<tr class="error required">...
I have submitted three patches for consideration as I am unsure of whether we want to to allow people creating their own as_methods (through subclassing etc) to be able to add their own classes separate from the above.
See this thread for more details: http://groups.google.com/group/django-developers/browse_thread/thread/fbd0c8cfbf1b819b/
The three patches do not yet have tests (or at least the existing tests have not been adjusted) and I haven't even looked at docs. Maybe when a decision is made, I'll tackle that. Or if anyone else wants to...
Change History (46)
comment:1 Changed 8 years ago by Waylan Limberg <waylan@…>
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:4 Changed 8 years ago by SmileyChris
- Triage Stage changed from Unreviewed to Design decision needed
comment:22 Changed 8 years ago by ubernostrum
- Resolution set to duplicate
- Status changed from new to closed
comment:23 Changed 8 years ago by SmileyChris
- Patch needs improvement set
- Resolution duplicate deleted
- Status changed from closed to reopened
- Summary changed from [patch] Add HTML classes to fields in newforms as_methods: "required" & "error" to [patch] Add "required" & "error" CSS classes to form rows in as_* methods
comment:29 Changed 7 years ago by telenieko
- Summary changed from [patch] Add "required" & "error" CSS classes to form rows in as_* methods to Add "required" & "error" CSS classes to form rows in as_* methods
- Triage Stage changed from Design decision needed to Accepted
Changed 7 years ago by SmileyChris
comment:37 Changed 5 years ago by jacob
- Resolution set to fixed
- Status changed from reopened to closed