How to specify rows and columns of a <textarea > tag using wtforms

前端 未结 9 2144
暗喜
暗喜 2021-02-18 22:40

Constructing a wtforms\' TextAreaField is something like this:

content = wtf.TextAreaField(\'Content\', id=\"content-area\", validators=[validators.Required()])
         


        
9条回答
  •  青春惊慌失措
    2021-02-18 23:05

    You are not supposed to do it in the place where you declare the widget. You have do it in the template. For eg:

    {{form.content(rows='50',cols='100')}}
    

    Need to ensure the rows and cols are specified as a string.

提交回复
热议问题