Topic: is-invalid class for validation is not working for select
noveltytech pro premium priority asked 3 years ago
Hi, I'm having an issue with the form validation of select component.
For MDBInput, I add an is-invalid
class to make the borders red but adding the same class to the MDBSelect is not working.
// This works
<MDBInput
label="Email *"
id="email"
type="text"
className="is-invalid"
/>
// This doesn't work
<MDBSelect
label="Role*"
id="role"
data={roleOptions}
className="is-invalid"
/>
How do I show the invalid state in the MDBSelect?
Wojciech Staniszewski staff answered 3 years ago
Unfortunately, MDBSelect
does not support validation. However, we will add the inputClassName
property, so you will be able to add the in-valid
class to the select input.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB React
- MDB Version: MDB5 1.4.0
- Device: Dell
- Browser: Google Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: No