hello everyone,
Im still new to YII and is currently working on my first project.
Ive been wondering about how on form conditional validations can be done, for eg:-
In my view I have two time pickers like:-
<div class="row" id="start_time">
<?php echo $form->labelEx($model,'startTime'); ?>
<?php Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
$this->widget('CJuiDateTimePicker',array(
'model'=>$model,
'attribute'=>'startTime',
'mode'=>'time' ,
'options'=>array("timeFormat"=>'hh:mm:ss'),
'language' => ''
));
?>
<?php echo $form->error($model,'startTime'); ?>
</div>
<div class="row" id="msg1">
</div>
<div class="row" id="end_time">
<?php echo $form->labelEx($model,'endTime'); ?>
<?php Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
$this->widget('CJuiDateTimePicker',array(
'model'=>$model,
'attribute'=>'endTime',
'mode'=>'time' ,
'options'=>array("timeFormat"=>'hh:mm:ss'),
'language' => ''
));
?>
<?php echo $form->error($model,'endTime'); ?>
</div>
I need to check if the start time is always greater than end time, I know this is really basic but how can I achieve this?
Thanks a lot for your time, really appreciate it!
Cheerz!