Opened 20 years ago
Closed 18 years ago
#1799 closed enhancement (wontfix)
Replace dots by dashes or hyphens from form fields id's of related objects
| Reported by: | David Elias | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | |
| Severity: | trivial | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Dots in html id's gives an error in CSS when trying to assign styles.
maybe this will do:
def get_id(self):
"Returns the HTML 'id' attribute for this form field."
return FORM_FIELD_ID_PREFIX + self.field_name.replace('.', '_')
Attachments (1)
Change History (6)
by , 19 years ago
| Attachment: | oldforms-id-replace-dots-by-underscore.diff added |
|---|
comment:1 by , 19 years ago
| Has patch: | set |
|---|---|
| Triage Stage: | Unreviewed → Design decision needed |
Not sure it would be worth committing changes to oldforms at this point in time. Is this an issue in newforms too?
comment:2 by , 19 years ago
| Component: | Admin interface → django.newforms |
|---|---|
| Triage Stage: | Design decision needed → Accepted |
Should be fixed, but only in newforms.
comment:4 by , 18 years ago
I'm having some trouble decoding the ticket title "...form fields id's of related objects". Using the normal recipe for creating a newform, fields are created as properties and thus does can not contain dots (syntactically incorrect).
However if you manually alter the fields / base_fields properties of the form, you could make a field with a dot in the name.
Is it Django's problem, if you manually tries to break things?
comment:5 by , 18 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Not an issue with newforms; wont fix oldforms.
while newforms are under development here is a patch :)