Multiselect with `required` attribute


Topic: Multiselect with `required` attribute

ilya pro premium asked 4 months ago

Hi, I'm trying to create a form with mandatory multiselect: I want the user to be required to select at least one value (see snippet). If I try to submit the form without selecting anything in the multiselect, no validation popup is displayed and the browser console shows the following error: An invalid form control is not focusable.

Expected behavior

When you submitting a form, a popup "This field is required" should appear, like it does with text inputs.

Resources (screenshots, code snippets etc.)

https://mdbootstrap.com/snippets/standard/ilya/6223388


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 Standard
  • MDB Version: MDB5 6.4.2
  • Device: Laptop
  • Browser: Firefox 129.0.1
  • OS: Linux
  • Provided sample code: No
  • Provided link: Yes