I'm rendering a form. I would like to put a mark next to all the fields that must be filled in. Simple stuff usually... but I've no idea how to access that information!
{% if field.required %}REQUIRED!!{% endif %}
doesn't bring any love...
I'm rendering a form. I would like to put a mark next to all the fields that must be filled in. Simple stuff usually... but I've no idea how to access that information!
{% if field.required %}REQUIRED!!{% endif %}
doesn't bring any love...
I usually write out the html for each of my form elements, so I have a little more control over each one. Then you can add an * for required or REQUIRED!!.
<p><label>Title: *<br />
{% if form.title.errors %}<ul class="errorlist">{{ form.title.errors }}</ul>{% endif %}
{{form.title}}
</label></p>
<p><label>Category:<br />
{% if form.category.errors %}<ul class="errorlist">{{ form.category.errors }}</ul>{% endif %}
{{form.category}}
</label></p>