MDB Multiple Select Default Value - Material Design For Bootstrap
Có thể bạn quan tâm
Hi,
I encounter an issue while trying to determine default value for my multiple mdb-select and while the values are numbers.The multiple mdb-select works fine when it's string values.
This is my select :
<select id="product" name="product[]" class="mdb-select md-form initialized" multiple="" searchable="Search"> <option value="">None</option> <optgroup label="Products Cat 1"> <option value="22">Product 1</option> <option value="23">Product 2</option> <option value="24">Product 3</option> <option value="25">Product 4</option> </optgroup> <optgroup label="Products Cat 2"> <option value="1">Product 5</option> <option value="2">Product 6</option> <option value="3" selected>Product 7</option> <option value="4">Product 8</option> </optgroup> </select>Of course, I initialized the select :
$('.mdb-select').material_select();My problem is : the mdb select displayed don't have the product with value "3" checked (Product 7 in my case), it has the product with value "22" checked instead (Product 1)...
I tried to destroy et initialize again the select but it did nothing.I also tried to display the value of my select in console and I have this result :["", "22", "3"] instead of ["3"].
I don't want the "22" value, I never checked it ! The value "3" isn't checked in my select neither...
Thank you.
EDIT : Snippet if needed : https://mdbootstrap.com/snippets/jquery/o1ivier/433268
Piotr Glejzer staff commented 6 years ago
Yea, I see the problem. Sorry about that bug. I added a task for that to check/repair it as soon as possible.
Yea, I see the problem. Sorry about that bug. I added a task for that to check/repair it as soon as possible.
Please insert min. 15 characters. PublishO1ivier priority commented 6 years ago
Hello,
Do you know approximately when will this problem be solved ?
Thanks
Hello,
Do you know approximately when will this problem be solved ?
Thanks
Please insert min. 15 characters. PublishPiotr Glejzer staff commented 6 years ago
I'm already looking into this. I will try to fix this a soon as possible but It will be probably fixed in the next release.
I'm already looking into this. I will try to fix this a soon as possible but It will be probably fixed in the next release.
Please insert min. 15 characters. Publish Add commentTừ khóa » Html Select Set Default Value Jquery
-
Set The Default Value In Dropdownlist Using JQuery - Stack Overflow
-
How To Set The Default Value For An HTML
-
How To Reset Selected Value To Default Using JQuery ? - GeeksforGeeks
-
Jquery Set Default Value Of Dropdown Code Example
-
Jquery Select Option Set Default Value Code Example
-
Set A Default Selection On Select Box Dropdown List Using Jquery.
-
How Can I Set The Default Value For An HTML
-
HTML DOM Option DefaultSelected Property - W3Schools
-
How To Set Selected Value On Dropdownlist Using Jquery - CodeProject
-
Bind A Dropdown List And Set A Default Value In JQuery - C# Corner
-
Javascript – JQuery Select2 Set Default Value From An Option In List
-
How To Set Default Value To Dropdownlist Using Jquery - MSDN
-
Set Value In DropDown Select Option HTML JQuery 3.4.0 - YouTube
-
Setting Default Values In A Question With Multiple Dropdowns Or A ...