One error message for few badly filled fields

Is there anyway how to show One single message in errorSummary but set class ‘error’ for couple fields ?

need this?




public function rules(){

    return array(

        array('username, password', 'required', 'message'=>'your custom message',),

    );

}



maybe?


<?php echo CHtml::errorSummary($model); ?>

sorry I forgot to mention main point here, that i’m looking solution for custom (my own) validator.

Now I found only that one




$this->addErrors(array('username' => '', 'password' => 'incorrect username or password'));



In that case both fields will have class .error but message will be only one, and Yes i could show it with help errorSummary($model)