Answer the question
In order to leave comments, you need to log in
How to hang an event on select class="form-control select2"?
<div class="form-group col-md-6" style="overflow:hidden; padding-left: 0px;">
<label for="field-1" class="control-label">Направление</label>
<?php if (is_array($directions)): ?>
<select id="direction" class="form-control select2" name="direction[]" style="width: 100%;" multiple>
<?php foreach ($directions as $direction): ?>
<option value="<?=$direction['ID']?>">
<?php echo $direction['NAME']; ?>
</option>
<?php endforeach; ?>
</select>
<?php endif; ?>
</div>
$(document).on('change', '#direction', function () {
console.log('yes');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question