Using Textarea

1
2
3
4
5
6
7
8
9
from django import newforms as forms

class myForm ( forms.Form ):

    foo = forms.CharField ( maxlength=20 )
    bar = forms.CharField ( maxlength-20 )

    # Now here's the Textarea
    baz = forms.CharField ( widget=forms.widgets.Textarea() )

More like this

  1. "Dynamic" form with a hidden field by flaxter 5 years, 1 month ago
  2. FCKWidget for NewForms by Digitalxero 6 years, 2 months ago
  3. Convert an instance to a dictionary for use in newforms by SmileyChris 7 years ago
  4. assign fields dynamically in newforms by rubic 7 years, 1 month ago
  5. Form row filter by kylefox 6 years, 2 months ago

Comments

rubic (on February 27, 2007):

It's probably also worth mentioning that you may assign the rows and columns attributes in the widget:

widget=forms.widgets.Textarea(attrs={'rows':4, 'cols':60})

#

Tobu (on October 15, 2007):

Thanks, I was rather confused that the naive

baz = forms.Textarea()

failed silently.

#

(Forgotten your password?)