Search code examples
phpjquerydatepickeryii2

How to use onSelect event in Kartik datePicker?


I am using kartik datePicker in my site but whenever I try to use onSelect event the doesn't triggered I don't know what is the problem. I searched a lot but didn't find any solution. This is my code:

<?php
                    echo DatePicker::widget([
                    'name' => 'check_issue_date',
                    'type' => DatePicker::TYPE_INLINE,
                    'options' => ['placeholder' => 'Select issue date ...', 'id' => 'date-picker'],
                    'pluginOptions' => [
                        'format' => 'dd-M-yyyy',
                        'todayHighlight' => false,
                        'onSelect' => 'function(dateText, inst) {
                            alert("hello");
                        }'
                    ]
                    ]);
?>

Solution

  • Look at pluginEvents on this page http://demos.krajee.com/widget-details/datepicker#settings