Topic: select - add / remove values dynamically in JS

ilya premium asked 3 months ago

Is there any example how I can set options on an existing select field dynamically with javascript?

Kamila Pieńkowska staff answered 3 months ago

You cannot set options on existing Select if it was initiated. You need to dispose of it and then init with new options.

If you want to know how to initialize select with JS here is an example:

Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.2
  • Device: any
  • Browser: any
  • OS: any
  • Provided sample code: Yes
  • Provided link: No