Guest User

Untitled

a guest
Jun 25th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. {% block content %}
  2. <div class="row">
  3. <div class="col-md-4">
  4. {{ wtf.quick_form(form) }}
  5. </div>
  6. </div>
  7. {% endblock %}
  8.  
  9. from flask_wtf import FlaskForm
  10. from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
  11. from wtforms import HiddenField
  12. from wtforms.validators import DataRequired, Length
  13.  
  14.  
  15. class MyForm(FlaskForm):
  16. myhidden = HiddenField()
  17. textblock = TextAreaField('textblock', validators=[Length(min=0, max=2000)])
  18. submit = SubmitField('Submit')
  19.  
  20. form = MyForm()
  21. ...
  22. return render_template('form.html', title='my form', form=form)
  23.  
  24. form.myhidden = "test value"
Add Comment
Please, Sign In to add comment