2amigos/yiiwheels

Field color when validation raises error

Closed this issue · 2 comments

I tried to put WhDatePicker & WhRedactor in a form, but when form validation raises errors, those components don't turn red like normal text field (textFieldControlGroup). Is there a way to set them like yiistrap's control groups? I tried something like:

echo $form->labelEx($model, 'date_start');
$this->widget('yiiwheels.widgets.datepicker.WhDatePicker', array(
'model'=>$model,
'attribute'=>'date_start',
'pluginOptions'=>array(
'format'=>'mm/dd/yyyy',
),
));
echo $form->error($model, 'date_start');

but the label and widget didn't turn red when validation raised an error.

Hi @re1naldo

Unfortunately there is no way to do that without coding that feature yourself.

I really do not want to start coding an extension of TbActiveForm as I used to do with YiiBooster, because we will end up having the same issues with the code base.

Antonio,

Thanks for your kind response. I understand the issue.