I have a date field in a form widget CActiveForm. The date field is a CJuiDatePicket widget. I would like to put a control so that the user can not enter a date that is in the past.
My code is
<div class="row">
<?php echo $form->labelEx($model,'date'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
'name'=>'Menu[date]',
'id'=>'Menu_date',
'value'=>Yii::app()->dateFormatter->format("yyyy-MM-dd",strtotime($model->date)),
'options'=>array(
'showAnim'=>'fold',
'dateFormat'=>'yy-mm-dd',
'minDate'=>'new Date()'
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
)); ?>
<?php echo $form->error($model,'date'); ?>
</div>
The user no longer has the possibility to select the dates in the pass. Now I want a controller that has an error message if input is a date manually in the pass.