Topic: select - add / remove values dynamically in JS

ilya premium asked 7 months ago


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


Kamila Pieńkowska staff answered 7 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: https://mdbootstrap.com/snippets/standard/kpienkowska/6043307



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