P粉3115638232023-09-01 10:14:31
"your text"
as the string after the function, which is invalid and may be a bug. jQuery(function($){ ... )}
inside the function.
element you opened was not closed properly, it seems you closed it before the
The following should solve this problem:
HTML
<div class="row">
<form id="search_vendor_form">
<select name="sel-01[]" id="sel-01" class="select2-multiple">
<option></option>
<option value="AL">Alabama</option>
<option value="CA">California</option>
<option value="NY">New York</option>
<option value="TX">Texas</option>
<option value="WY">Wyoming</option>
</select>
</form>
</div>
<div class="row">
</div>
<div class="row">
</div>
JS
jQuery(function($){
$('.select2-multiple').select2MultiCheckboxes({
placeholder: "Choose multiple elements",
});
$(document).on('change','#sel-01',function(){
console.log($('#search_vendor_form').serialize())
});
});
reply0