Yanuar Ihsan
Yanuar Ihsan

Reputation: 115

Hide historical dropdown selected value in Yii2 DatePicker widget

enter image description here

How to hide history dropdown list in Yii2 kartik select2? This is my source code:

<div class="col-sm-offset-2 col-sm-10" style="margin-left:135px;margin-bottom:15px">
<label class="control-label">Range Perjalanan Dinas</label>
    <?= DatePicker::widget([
    'type' => DatePicker::TYPE_RANGE,
    'model' => $model,
    'attribute' => 'tgl_mulai',
    'attribute2' => 'tgl_selesai',
    'options' => ['placeholder' => 'Start date'],
    'options2' => ['placeholder' => 'End date'],

    'form' => $form,
    'pluginOptions' => [
        'format' => 'dd-mm-yyyy',
        'autoclose' => true,
    ]
]); ?>
</div>

Upvotes: 2

Views: 2325

Answers (2)

jithin
jithin

Reputation: 920

Try 'autocomplete' => 'off' in your date picker options:

<?= DatePicker::widget([
        'type' => DatePicker::TYPE_RANGE,
        'model' => $model,
        'attribute' => 'tgl_mulai',
        'attribute2' => 'tgl_selesai',
        'options' => ['placeholder' => 'Start date','autocomplete' => 'off'],
        'options2' => ['placeholder' => 'End date'],

        'form' => $form,
        'pluginOptions' => [
            'format' => 'dd-mm-yyyy',
            'autoclose' => true,
        ]
    ]); ?>

Upvotes: 7

Nader Roua
Nader Roua

Reputation: 621

You may have to turn off the autocomplete in your form element

Turning off form autocomplete

Upvotes: -1

Related Questions