I am using bootstrap3 as the default template package in django_crispy_forms and trying to display a form with a crisp tag:
{% crispy form %}
My form class has the following helper attributes:
class TheForm(forms.Form): adv_var = forms.CharField(label="variable", max_length=70) value = forms.FloatField() def __init__(self, *args, **kwargs): super(TheForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_method = 'post' self.helper.form_class = 'form-inline' self.helper.field_template = 'bootstrap3/layout/inline_field.html' self.helper.layout = Layout( 'adv_var', 'value', ButtonHolder( Submit('submit', 'Start', css_class='button white') ) )
When submitting a form with errors, re-showing the template does not display errors, although I can print form._errors in the view and see a list of errors.
If I change helper.field_template to a different value (or delete it to set the default value), errors appear above each field, but I no longer get the built-in display.
How can I use django-crispy-forms to display all errors of this form in a separate div, for example?
mpaf source share