On Wed, May 21, 2008 at 3:16 PM, Chris <[EMAIL PROTECTED]> wrote: > Why does django by default output html id's in form fields? I thought > that it was good practice to use the class attribute in child elements > of an html form and to only use id on your container (parent) element > such as the form element. I think I read somewhere that classes are > faster to create and that id's are much slower to create.
I don't know about the speed of id versus class (and in 2008, does it really matter?), but keep in mind that, by default, Django's forms also use the label element, with its "for" attribute.[1] By definition, that attribute must match to an *id* of a form field in order to work properly. With that in mind, I certainly can't imagine any reason by assigning an id to a form field would be bad practice. -Gul [1] http://www.w3.org/TR/html401/interact/forms.html#adef-for --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---