#29011: forms.Field with space in dynamically generated forms.Form leads to 
wrong
assigned id in generated HTML form
-------------------------------+--------------------------------------
     Reporter:  pdehaye        |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Forms          |                  Version:  1.11
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by pdehaye:

Old description:

> If you do:
>
> {{{
> import django
> from django.forms import Form
> from django.forms import CharField
> PersonForm = type('Person', (Form,), {"work
> address":CharField(max_length=128)})
> person = PersonForm()
> person.as_ul()
> }}}
>
> You get
> {{{
> '<li><label for="id_work address">Work address:</label> <input
> type="text" name="work address" maxlength="128" required id="id_work
> address" /></li>'
> }}}
>
> I think the `id="id_work address" ` is suboptimal here. At least the doc,
> which references `id_<field-name>`, should be improved (also present in
> 2.0 doc)

New description:

 If you do:

 {{{
 import django
 from django.forms import Form
 from django.forms import CharField
 PersonForm = type('Person', (Form,), {"work
 address":CharField(max_length=128)})
 person = PersonForm()
 person.as_ul()
 }}}

 You get
 {{{
 '<li><label for="id_work address">Work address:</label> <input type="text"
 name="work address" maxlength="128" required id="id_work address" /></li>'
 }}}

 I think the `id="id_work address" ` is suboptimal here. Maybe everything
 should be underscored? At least the doc, which references `id_<field-
 name>`, should be improved (also present in 2.0 doc)

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29011#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.ea4535cecf1564ae385d17b7678f116b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to