Kartiv yii2 datepicker with model and custom id
<p>I am using kartik datepicker extension <a href="http://demos.krajee.com/widget-details/datepicker" rel="nofollow">http://demos.krajee.com/widget-details/datepicker</a> in Yii2.</p>

<p>Issue :</p>

<p>If I use this with custom id for input it does not show show model validations</p>

<pre><code>   echo kartik\date\DatePicker::widget([
             'model' =&gt; $objPatientModel,
             'form'=&gt;$objActiveForm,
             'attribute' =&gt; 'date_of_birth',
             'options' =&gt; ['placeholder' =&gt; 'Enter birth date ...', 'id' =&gt; 'patient_dob'], **// with id clientside validations for model does not work**
             'pluginOptions' =&gt; [
                 'format' =&gt; 'dd-mm-yyyy',
                 'endDate' =&gt; date('d-m-Y'),
             ]
         ]);
</code></pre>

<p>While below code works </p>

<pre><code> echo kartik\date\DatePicker::widget([
             'model' =&gt; $objPatientModel,
             'form'=&gt;$objActiveForm,
             'attribute' =&gt; 'date_of_birth',
             'options' =&gt; ['placeholder' =&gt; 'Enter birth date ...'],**//id is not used here**
             'pluginOptions' =&gt; [
                 'format' =&gt; 'dd-mm-yyyy',
                 'endDate' =&gt; date('d-m-Y'),
             ]
         ]);
</code></pre>

<p>But I want to use custom id .Any suggestions ?</p>