Opened 18 years ago

Closed 17 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)

oldforms-id-replace-dots-by-underscore.diff (481 bytes ) - added by david@… 17 years ago.
while newforms are under development here is a patch :)

Download all attachments as: .zip

Change History (6)

by david@…, 17 years ago

while newforms are under development here is a patch :)

comment:1 by Gary Wilson <gary.wilson@…>, 17 years ago

Has patch: set
Triage Stage: UnreviewedDesign 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 Malcolm Tredinnick, 17 years ago

Component: Admin interfacedjango.newforms
Triage Stage: Design decision neededAccepted

Should be fixed, but only in newforms.

comment:3 by anonymous, 17 years ago

All right - i will test with newforms.

comment:4 by chrj, 17 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 durdinator, 17 years ago

Resolution: wontfix
Status: newclosed

Not an issue with newforms; wont fix oldforms.

Note: See TracTickets for help on using tickets.
Back to Top