Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form_errors are not displayed #281

Open
neilmcguigan opened this issue Mar 21, 2023 · 0 comments
Open

form_errors are not displayed #281

neilmcguigan opened this issue Mar 21, 2023 · 0 comments
Labels

Comments

@neilmcguigan
Copy link

WTForms form_errors are form-wide (non-field) error messages

These are not displayed by render_form()

An example, say you wanted to validate that username and password are not the same...this would be a form-error and not an error specific to a given field

Could add something like this near the top of the form:

    {% if form.form_errors %}
    <div class="alert alert-danger" role="alert"><ul>
    {% for error in form.form_errors %}
        <li>{{error}}</li>
    {% endfor %}
    </ul></div>
    {% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants