Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the font colour of validation error messages in codeigniter

How can we change the font colour of validation error messages in Codeigniter?

like image 411
Gopesh Avatar asked Jan 20 '26 14:01

Gopesh


1 Answers

As per the documentation, you can change the delimiters applied to form validation errors, like this:

$this->form_validation->set_error_delimiters('<div class="error">', '</div>');

So, basically, all your errors will now be wrapped in a <div> with the CSS class 'error'. Now, in your CSS, just define:

.error {
    color: red;
}

More info: http://codeigniter.com/user_guide/libraries/form_validation.html#errordelimiters

like image 137
Rohan Prabhu Avatar answered Jan 23 '26 08:01

Rohan Prabhu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!