WTForms support for input readonly attribute?

前端 未结 4 1741
伪装坚强ぢ
伪装坚强ぢ 2021-02-04 02:14

Here they say it\'s not supported out of the box.

Do you know a way to make HTML input form fields use the \'readonly\' attribute with WTForms?

4条回答
  •  感情败类
    2021-02-04 02:38

    Another possibility is to use a hidden field, and then in your view, you can print out {{ form.field.data }} to display as text.

提交回复
热议问题