I want to show the selected data from multiple drop-down lists in Yii2 without sending it to the controller. The code I am using is as follows:

<?= $form->field($model, 'students')->dropDownList(ArrayHelper::map($students, 'studentId', 'name'), ["prompt" => "select...-", 'multiple' => 'multiple', 'onchange' => 'asd(this.value)']) ?>


function asd(vlaue) {
    // $('select').change(function (vlaue) {
    console.log(
        vlaue);
    // })
}

When I select the data from the dropdownlist, it just shows the same id multiple times in console. Any help would be highly appericated.

0 Answers