Hello all,
I’m running into an issue with adding errorCssClass to a custom validator.
Example (taken from CActiveForm in view):
<?php echo $form->error($model, 'something', array('errorCssClass'=>'has-error')); ?>
This works just fine with any validation, except my custom validator.
My question is: How can I assign the errorCssClass to the custom validation?
My validator looks like this:
public function validateDateComplete($attrib, $params)
{
if($this->date_complete < $this->date_start){
$this->addError('date_complete', 'The complete date needs to be after the start date.');
}
}
I’m not able to pass the custom CSS to the parent <div> when I run this…Any ideas?