I have an issue where the required asterisk is not showing even though a field is required.
Strange that when you submit and there are errors on the form the label now renders with an asterisk.
In the view:
<?php echo $form->labelEx($model,'password', array('class' => 'control-label col-sm-4','label'=>'Enter a New Password')); ?>
<?php echo $form->labelEx($model,'repeat_password', array('class' => 'control-label col-sm-4','label'=>'Repeat the New Password'))); ?>
The password one works.
Model:
array('email, password', 'required', 'except' => 'reset'),
array('password', 'required', 'on' => 'reset'),
array('email, password', 'length', 'max'=>255),
array('password', 'length', 'min' => 1),
array('repeat_password', 'required', 'on' => 'register, reset'),
array('repeat_password', 'compare', 'compareAttribute' => 'password', 'on' => 'register, reset'),
array('password', 'encrypt', 'on' => 'register, reset'),
Try changing it to:
array('password, repeat_password', 'required', 'on' => 'register, reset'),
array('repeat_password', 'compare', 'compareAttribute' => 'password', 'on' =>'register, reset'),
array('password', 'length', 'min' => 1),
array('password', 'encrypt', 'on' => 'register, reset')
I think it was overwriting the first rule. Not sure though.