How can I add a custom parameter to a field in a flask_wtf form-field. One of my requirements is to add the autocomplete="off"
to all password fields, but I can't seem to find out how I can add this parameter to a password field in flast_wtf generated form.
You can pass HTML attributes directly to form fields by name, with the exception of class
, which uses class_
to avoid the reserved word.
{{ form.password(autocomplete="off") }}
If you use a macro like this to render your fields, you can still pass it through **kwargs
:
{{ render_field(form.password, autocomplete="off") }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With