Welcome Guest, Not a member yet? Register   Sign In
Tweaking form_error()
#1

[eluser]3rdear[/eluser]
The form_error() function is currently returning the error message wrapped in a <p> tag, like so:
Code:
<p>Name field is required</p>

This is breaking my layout, so I want to change this so that it only outputs the error text string and let me worry about what element to place it in. Where would I make this change?
#2

[eluser]bubbafoley[/eluser]
you don't need to change anything. you can add delimeters as optional parameters

Code:
&lt;?php echo form_error('field name', '<div class="error">', '</div>'); ?&gt;

see: http://codeigniter.in.th/user_guide/libr...delimiters
#3

[eluser]3rdear[/eluser]
Nevermind! I found the delimiters function in the user guide.




Theme © iAndrew 2016 - Forum software by © MyBB