On Jun 22, 2006, at 1:36 PM, odonian gmail.com wrote:
> The use-case and problem I have is when using a generic
view and a
> form; suppose my object being edited has a field called
"description".
> I'd like to just use {{form.description}} in the
template, but the
> default size (cols=, rows=) isn't what I want. I can
setup my own
> <textarea> tag to display in the size I want, but
then I have to use
> the tag {{object.description}} within the textarea -
which is a
> problem
> when the user submits with an error, and the template
will show an
> error message, BUT not the new description which was
submitted, only
> the old one from the database.
CSS is the easiest way to deal with this specific issue.
Each Django
form element gets an id attribute of ``id_FIELDNAME``, so a
CSS rule
like::
#id_description { width: 30em; height 10em; }
Should do it for you.
Jacob
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---
|