blob: 6d9add5bb0a2c448dd37dc34d1a106c7f2bc6134 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{% extends 'base.html' %}
{% block main %}
<h2>WTForms in Flask</h2>
<p>Here we are using the Flask-WTF library to create and process a form. Flask-WTF also comes with CSRF protection and validation classes.</p>
<form method="post" action="{{ url_for('wtform') }}">
{% include 'flash_messages.html' %}
{{ form.csrf_token }}
<div class="form-group">
{{ form.firstname.label }} {{ form.firstname(class="form-control") }}
</div>
<div class="form-group">
{{ form.lastname.label }} {{ form.lastname(class="form-control") }}
</div>
<div class="form-group">
{{ form.email.label }} {{ form.email(class="form-control", placeholder="jdoe@example.com") }}
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% endblock %}
|