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: select - add / remove values dynamically in JS

ilya premium asked 8 months ago


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


Kamila Pieńkowska staff answered 8 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