Welcome Guest, Not a member yet? Register   Sign In
Editi validation errors style
#1

[eluser]Evollution[/eluser]
How can i edit validation errors style ?
#2

[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:
&lt;?php echo form_error('field name', '<div class="error">', '</div>'); ?&gt;
Or:
&lt;?php echo validation_errors('<div class="error">', '</div>'); ?&gt;

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB