Setting data on Select2 Multiple

hey everyone,

I need help on how to set data when using select2 multiple option. For single option, I will set it as follows;

 $('.select2').on('change', function (e) {

what change do we make for multiple? if i use the same setup, it only picks 1 record

Hi bro, I’am using like this. its work i hope for you document.addEventListener("DOMContentLoaded", () => { App.select2(); Livewire.hook('message.processed', (message, component) => { App.select2(); $('.select2').on('change', function () { @this.comments = $(this).val(); }); flatpickr('#dateRange', { mode: 'range', minDate: "today", maxDate: new Date().fp_incr(30) // 14 days from now }) }) })

1 Like