aboutsummaryrefslogtreecommitdiff
path: root/app/templates/wtform.html
diff options
context:
space:
mode:
Diffstat (limited to 'app/templates/wtform.html')
-rw-r--r--app/templates/wtform.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/templates/wtform.html b/app/templates/wtform.html
new file mode 100644
index 0000000..6d9add5
--- /dev/null
+++ b/app/templates/wtform.html
@@ -0,0 +1,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 %} \ No newline at end of file