Topic: Placeholder messing with select

infinity free asked 4 years ago


Hey Guys,

I have a select that I am calling $('.mdb-select').materialSelect(); on... Now if I populate values, It automatically selects the first one, which is not what I want.

So I have set data-placeholder='-- Please Select --' so that they manually have to choose the first one. But that did not work.

Because, I have jquery using the selected value as soon as it changes, and after populating this drop down, I see "-- Please Select --" as expected, when I choose the first time a value, and alert the value it's NULL.

If I change the value again the id it shows is 2 (which is the last one), If I then choose the first one again, it still alert's 2... It no longer changes the value.

It does seem to be quite inconsistent since one moment it works as expected and the next it does as explained above...

Any advise?


infinity free answered 4 years ago


I will say this though. It looks like it only happens to the select's that I populate dynamically. The first select who's pre-populated does not have this kind of problem...


Grzegorz Bujański staff commented 4 years ago

Hi. We fix value problem in 4.14.0. If you have any problem after update to 4.14.0 please create snippet here: https://mdbootstrap.com/snippets/ I will look at this.


infinity free commented 4 years ago

where in the download do I check the version?


Grzegorz Bujański staff commented 4 years ago

Inside readme.txt for example



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: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.13.0
  • Device: Laravel
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No