0👍
You have given selectpicker to both select tag so it will append options to both select tags.Just change your Jquery code like :
$('.selectpicker').selectpicker();
//for category dropdown
for (var i = 0; i < Object.keys(e).length; i++) {
var o = new Option(e[i].name, e[i].name);
$("#lunchBegins").append(o);
}
$("select[name='category']").selectpicker('refresh');
//for service dropdown, object1 is just dummy
for (var i = 0; i < Object1.keys(e).length; i++) {
var o = new Option(e[i].name, e[i].name);
$("#basic").append(o);
}
$("select[name='subcategory']").selectpicker('refresh');
- [Vuejs]-Use element ui upload Multiple pictures how to get the picture path store in imgarr arrary
- [Vuejs]-Vue.js API Call with Dynamic schema
Source:stackexchange.com