Checking the date for the Text Date field does not work.
http://sky-walker.net/temp/test/yii/testdate/index.php?r=site/login
The “required” check is performed if I asked it as needed.
What I want the text box to do is either red or green when the form is submitted, and also when the focus is lost with ajax. If it turns red, an error message should also appear.
From login.php
<div class="row">
<?php echo $form->labelEx($model,'textDate'); ?>
<?php echo $form->textField($model,'textDate'); ?>
<?php echo $form->error($model,'textDate'); ?>
</div>
From LoginForm.php
public $textDate;
From the rules ()
...array('textDate', 'date', 'format'=>'d/M/yyyy'),...
source
share