diff --git a/flask_bootstrap/templates/bootstrap/form.html b/flask_bootstrap/templates/bootstrap/form.html
index 43c9ff82..4a74c76f 100644
--- a/flask_bootstrap/templates/bootstrap/form.html
+++ b/flask_bootstrap/templates/bootstrap/form.html
@@ -121,6 +121,8 @@
{% set default_button_size = button_size or config.BOOTSTRAP_BTN_SIZE %}
{{ field(class='btn btn-%s btn-%s%s' % (button_map.get(field.name, default_button_style), default_button_size, extra_classes), **field_kwargs) }}
{% endcall %}
+ {%- elif field.type in ['CSRFTokenField', 'HiddenField'] -%}
+ {{ field()|safe }}
{%- elif field.type in ['FormField', 'FieldList'] -%}
{# note: FormFields are tricky to get right and complex setups requiring
these are probably beyond the scope of what this macro tries to do.
diff --git a/tests/conftest.py b/tests/conftest.py
index b09e315b..71a60f69 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -2,7 +2,7 @@
from flask import Flask, render_template_string
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
-from wtforms import BooleanField, PasswordField, StringField, SubmitField
+from wtforms import BooleanField, PasswordField, StringField, SubmitField, HiddenField
from wtforms.validators import DataRequired, Length
@@ -10,6 +10,7 @@ class HelloForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(1, 20)])
password = PasswordField('Password', validators=[DataRequired(), Length(8, 150)])
remember = BooleanField('Remember me')
+ hidden = HiddenField()
submit = SubmitField()
diff --git a/tests/test_render_field.py b/tests/test_render_field.py
index 6abc5fa2..52b380dc 100644
--- a/tests/test_render_field.py
+++ b/tests/test_render_field.py
@@ -7,11 +7,15 @@ def test():
form = hello_form()
return render_template_string('''
{% from 'bootstrap/form.html' import render_field %}
+ {{ render_field(form.csrf_token) }}
+ {{ render_field(form.hidden) }}
{{ render_field(form.username) }}
{{ render_field(form.password) }}
''', form=form)
response = client.get('/field')
data = response.get_data(as_text=True)
+ assert '' not in data
+ assert '' not in data
assert '