Reputation: 481
How do you add a conditional CSS class based on a Python if statement in the following example to show the has-success has-feedback
form element?
<div class="form-group {% if not error_username %} has-success has-feedback {% endif %}">
Upvotes: 27
Views: 20295
Reputation: 1761
Write if condition this way.
<div class="form-group {{'has-success has-feedback' if not error_username }}">
Upvotes: 53