tried to use jui/Datepicker within an ActiveForm:
<?= $form->field($model, 'valid_to')->textInput()->widget(DatePicker::className(),['clientOptions' => ['defaultDate' => '2014-01-01'],'dateFormat' => 'yyyy-MM-dd']) ?>
It works fine but unfortunaltely, it destroys the layout of the inputFiel of yii2´s "basic" template like this: the label is no longer located on top of the field but on the left, the surrounding of the field won´t be colored in green / red after js validation.
Is there a property of DatePicker like "do not override input field css"? What´s the right thing to do to solve this?
Following doesn´t work:
Here is the yii2 code:
<?= $form->field($model, 'id_currency')->textInput() ?>
<?= $form->field($model, 'valid_to')->widget(DatePicker::className(),['class' => 'form-control','clientOptions' => ['defaultDate' => '2014-01-01'],'dateFormat' => 'yyyy-MM-dd']) ?>
Output HTML:
<div class="form-group field-license-id_currency required">
<label class="control-label" for="license-id_currency">Id Currency</label>
<input type="text" id="license-id_currency" class="form-control" name="license[id_currency]">
<div class="form-group field-license-valid_to required">
<label class="control-label" for="license-valid_to">Valid To</label>
<input type="text" id="license-valid_to" name="license[valid_to]">
class="form-control" is missing in the datePicker input Field.