WTForms-How to prepopulate a textarea field?

Rasmus picture Rasmus · Feb 25, 2011 · Viewed 25k times · Source

Hi I have been trying to pepopulate a textareafield using something like this in the template.

{{form.content(value="please type content")}}

This works when the field is textfield primarily because the html accepts value for <input type="text"> but the same does not work for textarea... Can someone please help me with this?

Answer

hilquias picture hilquias · Mar 3, 2011

You can do it before rendering, something like:

form.content.data = 'please type content'

I'm new to WTForms though.