1

I have a form:

class simple_order(Form): order_info = TextAreaField() ,in the template i am added: {{form.order_info(cols=60, rows=20)}}

How to add text into render textarea, like value in the input tag?

2
  • There is a attribute named placeholder of textarea. Commented Apr 1, 2017 at 11:45
  • 1
    placeholder - displays the text inside a form field that disappears when it has focus Commented Apr 1, 2017 at 12:21

1 Answer 1

4

There are several ways to do it.

i. When creating a model you can do like below:

order_info = TextAreaField(default='This is default text')

ii. Before rendering the form, you can add the content:

form = simple_order()
form.order_info.data = 'This is default text'

Hope it helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.