python - Displaying form errors with django-boostrap3 -
i developing web application django , django-bootstrap 3.
i have several forms validated , throw error if wrong. however, don't want django-bootstrap show alert messages in dismissible red alert boxes. error messages below input fields sufficient.
how achieve this?
password change form example:
<form class="allign-bottom" method="post" enctype="multipart/form-data"> {% csrf_token %} {% bootstrap_form form %} {% buttons %} <button type="submit" class="btn btn-primary"> {% bootstrap_icon "glyphicon glyphicon-refresh" %} update password </button> {% endbuttons %} </form>
picture example:
in order not show dismissable alert box @ top should remove
{% bootstrap_messages %}
template tag, placed somewhere in html file.
this tag responsible showing potential errors (actually it's django messages, formatted bootstrap styling).
according source of {% bootstrap_messages %}
, template tag renders messages.html
iterates on messages , presents them (wraps each inside <div>
element).
Comments
Post a Comment