Material Select- How to set default value?


Topic: Material Select- How to set default value?

dxl pro asked 3 years ago

This is a pretty common scenario, so it should be supported. Instead of showing placeholder option, I want to preselect an option.


Damian Gemza staff answered 3 years ago

Hello dear dxl, Please check that link. Here you can read about how to implement default selection in Material Select. https://mdbootstrap.com/support/default-value-select-angular/ Best Regards, Damian

Gucciardi pro answered 2 months ago

I've found this solution to work fine

$('#mySelect option[value="optionValue"]').attr("selected", true);

Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No