Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


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.


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


poomkawin free 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?



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

  • ForumUser: 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