On Sat, May 14, 2011 at 5:20 PM, Shawn Milochik <[email protected]> wrote:
> One way:
>
> class CustomCharField(forms.CharField):
>
> def __init__(self, *args, **kwargs):
>
> super(CustomCharField, self).__init__(*args, **kwargs)
>
> self.widget=forms.TextInput(attrs={ 'class':'myclass' })
>
>
> class MyForm(forms.Form):
>
> field1 = forms.CustomCharField()
> field2 = forms.CustomCharField()
Thank you.
What is the convention for getting a pk id into a hidden form field?
Since {{ form.name }} is the convention for getting my name field HTML
rendered, I naturally tried {{ form.id }}, but it doesn't seem to know
about Django conventions I don't guess.
--
Greg Donald
destiney.com | gregdonald.com
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.