custom form error summary

Hi all,

Question about form custom error summary warnings content.

By default form validation error summary gives warning like: ‘my_field cannot be blank’. How can I change it into for example ‘its not a good idea to leave my_field blank’. Is it possible? Thanks in advance,

Jan

Yes, it’s possible. You can use custom messages for validation errors: http://www.yiiframework.com/doc/api/CValidator#message




public function rules(){

    return array(

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

    );

}



So simple, but so hard to find either using guide to yii or CForm description…

Thank you very, very much ::)

But my friends, one more thing…

I would like to have the ‘Please fix the following input errors:’ changable aswell. Is there an option for this?

Sorry, for newbie questions, but deadline in few days, dont have too much time to google through :)

Respect in advance,

Jan

See here. $header is what you want to change.

Thank you :)