I have problems display the default errors within a form I'm creating via crispy_forms using a custom template. Namely, the text "This field is required." is not present for two fields.
Please see, here
Here's the form's init code:
...
start_time = forms.TimeField(label='Start Time', required=True, input_formats=[TIME_FORMAT])
end_time = forms.TimeField(label='End Time', required=True, input_formats=[TIME_FORMAT])
...
Field('end_date', placeholder='dd/mm/yyyy'),
Field('start_time', placeholder='hh:mm (pm/am)', template="appointments/datetimefield.html"),
Field('end_time', placeholder='hh:mm (pm/am)', template="appointments/datetimefield.html"),
and the clean, save methods here:
Finally, the custom template:
{% load crispy_forms_field %}
<div id="div_{{ field.auto_id }}" class="form-group{% if field.errors %} has-error{% endif %}">
{% if field.label and form_show_labels %}
<label for="{{ field.id_for_label }}" class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}
<div class="controls col-xs-8 col-md-9 col-lg-9">
{% crispy_field field %}
</div>
</div>