how to disable submit button of wtform submit field?

Viewed 2708

this is a submit button code of a wtform:

{{ form.submit(class="w-50 btn btn-primary btn-sm submit-btn") }}

I am thinking of adding a class to it when it's clicked? i know a way of showing errors in wtform+jinja2 by adding class like this:

{% if reg_form.confirm_password.errors %}
   {{ reg_form.confirm_password(class="form-control form-control-sm is-invalid") }}
          <div class="invalid-feedback">
             {% for error in reg_form.confirm_password.errors %}
                <span>{{ error }}</span>
             {% endfor %}
          </div>
   {% else %}
       {{ reg_form.confirm_password(class="form-control form-control-sm")}}
   {% endif %}

i looked at the docs of submitField but I cannot see a way of disabling it. https://wtforms.readthedocs.io/en/stable/fields.html

0 Answers
Related