Yii form validation error messages

When Yii gives an error message for form validation, if we try to reenter into input text field the text is in red color. Any idea on how to avoid this.

See the image below.



This is a CSS question. The CSS styles that affect the way inputs are displayed when the input is invalid is defined in Yii’s stylesheet form.css:

div.form div.error input,

div.form div.error textarea,

div.form div.error select,

div.form input.error,

div.form textarea.error,

div.form select.error


	background: #FEE;

	border-color: #C00;


Rather than directly modifying Yii’s form.css class, I would recommend including your own stylesheet, after form.css, and overriding styles. Actually, my guess is that you’re already doing this – and you’re setting the color attribute for invalid inputs to red.