Select Field not refreshing after being changed from javascr


Topic: Select Field not refreshing after being changed from javascript

dwilbur pro premium priority asked a year ago

Expected behavior

When you use javascript to reset the value of a select field to the first option, it would show on the screen that the selected field of the select element is the first option.

Actual behavior

Value of select field is reset but the window still displays the previously selected field so now the select element's value is the value of the first option but what is actually displayed on screen is still the previously selected element

Resources (screenshots, code snippets etc.)

https://mdbootstrap.com/snippets/standard/wilbur/5494645


kpienkowska staff answered a year ago

There is a difference between the select element used for initiation and the select component. You need to use select setValue method to change the value. Overwriting select element value is not a correct approach.


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
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.1.0
  • Device: Dell Laptop
  • Browser: Google Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes
Tags