Auto-select Select


Topic: Auto-select "Select"

north27 pro asked 5 years ago

Is it possible to auto-select and MDB Select element?


Mikołaj Smoleński staff commented 5 years ago

You mean pre-select an element? Best regards


north27 pro commented 5 years ago

Yes, pre select a "Select" element.


poomkawin answered 5 years ago

Just add 'selected' to the option you wanted to be pre-selected.

Take a look here: https://mdbootstrap.com/snippets/jquery/poomkawin/1108746


Mikołaj Smoleński staff commented 5 years ago

@north27 please take a look at @poomkawin solution. Thanks for it! Best regards


north27 pro commented 5 years ago

Hi, Thanks for the reply. This works when populating select. Any solution to pre-select/auto-select after select is populated?


Mikołaj Smoleński staff answered 5 years ago

Here's an example code of selecting value dynamically: https://mdbootstrap.com/snippets/jquery/mikolaj-smolenski/574924

Best regards


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: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.2
  • Device: PC
  • Browser: Chrome
  • OS: Mac
  • Provided sample code: No
  • Provided link: No