Closed alexweb-zz closed 10 years ago
Ok. Found why it's not working. The "form" parameter should be specified:
<?php
$model->end_date = ($model->isNewRecord)
? null
: date(Yii::$app->params['dateFormat'], $model->end_date);
?>
<?= DatePicker::widget([
'model' => $model,
'form' => $form,
'attribute' => 'end_date',
'pluginOptions' => [
'format' => 'yyyy-mm-dd',
'todayHighlight' => true,
'clearButton' => false,
]
]);?>
I'm using DatePicker this way:
And I have 'required' rule for 'start_date'. When I click Submit button, error doesn't appear (client validation). Is it supported or I need to use ajax validation?