-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
bugSomething isn't workingSomething isn't working
Description
https://getbootstrap.com/docs/4.5/components/forms/#how-it-works
says
Bootstrap scopes the :invalid and :valid styles to parent .was-validated class, usually applied to the <form>. Otherwise, any required field without a value shows up as invalid on page load. This way, you may choose when to activate them (typically after form submission is attempted).
To reset the appearance of the form (for instance, in the case of dynamic form submissions using AJAX), remove the .was-validated class from the <form> again after submission.
The correct way to do this is
if (!this.checkValidity()) {
this.classList.add('was-validated');
return;
} else {
this.classList.remove('was-validated');
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working