You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Responsive navbar expand/collapse classes](#responsive-behaviors) (e.g., `.navbar-expand-lg`) are combined with the `$breakpoints` map and generated through a loop in `scss/_navbar.scss`.
Copy file name to clipboardExpand all lines: packages/docs/content/forms/validation.mdx
+18-15
Original file line number
Diff line number
Diff line change
@@ -30,21 +30,6 @@ import {
30
30
CRow,
31
31
} from'@coreui/react/src/index'
32
32
33
-
{/* ## How it works
34
-
35
-
Here's how form validation works with Bootstrap:
36
-
37
-
- HTML form validation is applied via CSS's two pseudo-classes, `:invalid` and `:valid`. It applies to `<input>`, `<select>`, and `<textarea>` elements.
38
-
- CoreUI for 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).
39
-
- 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.
40
-
- As a fallback, `.is-invalid` and `.is-valid` classes may be used instead of the pseudo-classes for [server-side validation](#server-side). They do not require a `.was-validated` parent class.
41
-
- Due to constraints in how CSS works, we cannot (at present) apply styles to a `<label>` that comes before a form control in the DOM without the help of custom JavaScript.
42
-
- All modern browsers support the [constraint validation API](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#the-constraint-validation-api), a series of JavaScript methods for validating form controls.
43
-
- Feedback messages may utilize the [browser defaults](#browser-defaults) (different for each browser, and unstylable via CSS) or our custom feedback styles with additional HTML and CSS.
44
-
- You may provide custom validity messages with `setCustomValidity` in JavaScript.
45
-
46
-
With that in mind, consider the following demos for our custom form validation styles, optional server-side classes, and browser defaults.*/}
47
-
48
33
## Example
49
34
50
35
For custom CoreUI form validation messages, you'll need to add the `noValidate` boolean property to your `<CForm>`. This disables the browser default feedback tooltips, but still provides access to the form validation APIs in JavaScript. Try to submit the form below; our JavaScript will intercept the submit button and relay feedback to you. When attempting to submit, you'll see the `:invalid` and `:valid` styles applied to your form controls.
@@ -692,3 +677,21 @@ return (
692
677
</CForm>
693
678
)
694
679
```
680
+
681
+
## Customizing
682
+
683
+
### CSS variables
684
+
685
+
CoreUI for React components use local CSS variables for validation for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
0 commit comments