Skip to content

Incorrect errorClass in documentation #213

Closed
@aDramaQueen

Description

@aDramaQueen

Hi,
this is a small one. Your documentation is not correct. Or your JavaScript. Depends what you define as source of truth.
In your documentation you write:

class="invalid" acts as a flag for the fields having errors after the form has been POSTed

Maybe this was true in older instances of this project, but right now (April 2023) your defaults look like this:

let defaults = {
    modalID: "#modal",
    modalContent: ".modal-content",
    modalForm: ".modal-content form",
    formURL: null,
    isDeleteForm: false,
    errorClass: "is-invalid",   //<---------- ERRORS
    asyncUpdate: false,
    asyncSettings: {
        closeOnSubmit: false,
        successMessage: null,
        dataUrl: null,
        dataElementId: null,
        dataKey: null,
        addModalFormFunction: null
    }
};

Right now, if you copy & past your second example & you put in an invalid username/password you will be redirected to the modal HTML page, since your looking for wrong error indicators in your JavaScript.

If you correct the documentation, you have to correct more then this quote from above. You also use the "wrong" class in the Django Templates. I would recommend to correct the documentation, because Bootstrap does also use the is-invalid class as indicator for server side validation: Bootstrap Documentation - Validation.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions