I'm trying to pepopulate a wtforms-textareafield with a value.
I defined a class:
from flask_wtf import Form from wtforms import TextField, RadioField, TextAreaField class Contact(Form): email = TextField('Name : ') subject = TextField('Subject:') description = TextAreaField('Description:', default="please add content") I'm using python, here i render template :
from app.mod_contact.contact import Contact //some code contact = Contact() return render_template('contact/contact.html') In template i did this:
<div class="form-group"> {{ contact.description.label(class_="control-label col-xs-3") }} <div class="col-xs-6"> {{ contact.description(class_="form-control")}} </div> </div> But the default text is not displayed,it's blank.
I also tried to add value on template:
{{ contact.description(class_="form-control" ,value="please type content")}} But no result. Can somebody help me? Thanks in advance.
Flaskinstance and it works OK withdefaultkeyword. I assume your problem might be somewhere in re-defining fielddescription.