I want to enable below button based on the boolean value from context i.e. {{ enable }}. if enable is True then make it enable otherwise disabled.
<input type="submit" name="upload" class="btn btn-primary" value="Upload" disabled/>
I want to enable below button based on the boolean value from context i.e. {{ enable }}. if enable is True then make it enable otherwise disabled.
<input type="submit" name="upload" class="btn btn-primary" value="Upload" disabled/>
The simplest way to do that is:
<input type="submit" name="upload" class="btn btn-primary"
value="Upload" {% if not enable %}disabled{%endif%} />
Try something like this to disable the button based on the condition in Django.
<input type="button" {% if a==b %} disabled="true" {% endif %}/>
Here 'a' and 'b' refers to the variables coming from the Django view.