TextArea in Django Form

July 17, 2010

If you need to define a char field in a Django form so that it is a textarea, use the following in the form definition:

class ResultsForm(forms.Form):
    results = forms.CharField(widget=forms.Textarea(attrs={'width':"100%", 'cols' : "80", 'rows': "20", }))

Tags: django form textarea