jnosul
(Nosul Jan)
August 15, 2010, 4:04pm
1
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
samdark
(Alexander Makarov)
August 15, 2010, 4:14pm
2
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',),
);
}
jnosul
(Nosul Jan)
August 15, 2010, 4:32pm
3
So simple, but so hard to find either using guide to yii or CForm description…
Thank you very, very much
jnosul
(Nosul Jan)
August 16, 2010, 10:54am
4
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
Y11
(Y!!)
August 16, 2010, 10:59am
5
See here . $header is what you want to change.