Hello,
I'm using crispy forms with zurb foundation. Since crispy-forms-foundation isn't that advanced, I need to develop it further by myself. So I've encountered a problem. I need to change the CSS classes of the surrounding div dynamically:
<div class="row">
<div id="div_id_title" class="CLASS NEEEDED HERE">
<label class="requiredField" for="id_title">
<input id="id_title" class="large-12 columns textinput textInput" type="text" name="title" maxlength="50">
</div>
</div>
The template (django_crispy_forms/templates/***/field.html) says: <div id= [...] class="[...]{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
field.css_classes is always empty. The above HTML has been created with the following crispy forms layout:
self.helper.add_layout(Layout(Row(Field('title', css_class='large-12 columns')), [...] ))
As you can see, the css_class is present in the input, but I need it in the div_id_title.
Any ideas?