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. Multiple-Submit-Button Widget for Choice Field by Archatas 4 years, 9 months ago
  2. use oldforms validators in newforms forms by garywilson 6 years, 1 month ago
  3. FCKWidget for NewForms by Digitalxero 5 years, 3 months ago
  4. TinyMCE Widget by semente 3 years, 8 months ago
  5. "Dynamic" form with a hidden field by flaxter 4 years, 1 month 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?)