is-invalid class for validation is not working for select


Topic: is-invalid class for validation is not working for select

noveltytech pro premium priority asked 6 months 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 6 months 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.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • 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