So, i would like to change the style on a input element when i get a form_error on that element.
In my controller, i have all the form_validation rules, and every inputelement attributes
if ($this->form_validation->run() == FALSE)
{
$data['username'] = array(
'name' => 'username',
'id' => 'username'
);
$data['password'] = array(
'type' => 'password',
'name' => 'password',
'id' => 'password'
);
}
And in my View, i am printing them out.
<li>
<label for="username" class="bold">Username</label>
<span class="input-prepend">$</span>
<?php echo form_input($username); ?>
</li>
So, i need the easiset way to change the class on the corrisponding element that gets a form error. Is it any easy way to do this?
Please, let me know if i'm explaining bad :) Thank you.