Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // bug in materialize causing values in multi dropdown to not update, fix below
- $('select').material_select();
- $('select').change(function(){
- var newValuesArr = [],
- select = $(this),
- ul = select.prev();
- ul.children('li').toArray().forEach(function (li, i) {
- if ($(li).hasClass('active')) {
- newValuesArr.push(select.children('option').toArray()[i].value);
- }
- });
- //select.val(newValuesArr);
- $(select).data('var', newValuesArr)
- });
Advertisement
Add Comment
Please, Sign In to add comment