Opened 13 years ago
Closed 12 years ago
#17921 closed Uncategorized (wontfix)
Add default "error" and "required" css classes to form rows
Reported by: | Haisheng HU | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | hanson2010@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
Ticket #3512 talked about this feature a few years ago. User can now add error_css_class and required_css_class to its own Form/ModelForm subclass. But it should be more convenient/straightforward to have these attributes assigned in its parent BaseForm.
The default output of a required/error row will be as follows.
<tr class="required error"> <th><label for="id_name">Name:</label></th> <td> <ul class="errorlist"><li>This field is required.</li></ul> <input id="id_name" type="text" name="name" maxlength="256" /> </td> </tr>
Attachments (1)
Change History (2)
by , 13 years ago
Attachment: | base_form_css_class.diff added |
---|
comment:1 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I'm going to WONTFIX, because:
- this isn't a very common need, and you can already achieve what you need by subclassing.
- there are no other HTML-related attributes passed to
__init__
. It doesn't make sense to complicate the constructor ofForm
for this requirement.
Note:
See TracTickets
for help on using tickets.
add error_css_class and required_css_class to BaseForm's init method