[eluser]InsiteFX[/eluser]
This is in the CodeIgniter User Guide!
Code:
Changing the Error Delimiters
By default, the Form Validation class adds a paragraph tag (<p>) around each error message shown. You can either change these delimiters globally or individually.
1.Changing delimiters Globally
To globally change the error delimiters, in your controller function, just after loading the Form Validation class, add this:
$this->form_validation->set_error_delimiters('<div class="error">', '</div>');
In this example, we've switched to using div tags.
2.Changing delimiters Individually
Each of the two error generating functions shown in this tutorial can be supplied their own delimiters as follows:
<?php echo form_error('field name', '<div class="error">', '</div>'); ?>
Or:
<?php echo validation_errors('<div class="error">', '</div>'); ?>
InsiteFX