I m using the form validation library and have something like this in the view
<p>
<label for="NAME">Name <span class="required">*</span></label>
<?php echo form_error( NAME ); ?>
<br /><input id="NAME" type="text" name="NAME" class="" value="<?php echo set_value( NAME ); ?>" />
</p>
I d like to add a class to the input that is dependent on the form error so i could have something like this
<input id="NAME" type="text" name="NAME" class="<?php echo $error;?>" value="<?php echo set_value( NAME ); ?>"
I realize that it would have to be a bit more complicated, but I d like to this this without creating a custom rule callback for every field.
Thanks ~Daniel