Welcome Guest, Not a member yet? Register   Sign In
Help displaying errors with Form Validation
#1

[eluser]theQco[/eluser]
I'd like to be able to display the form validation errors at the top of the page and then have each form element (like input) outlined in red or have an arrow next to it to tie the two together.

I haven't found a way to do this yet. All I have found is the echo form_error() which places the error next to the form element.

Any help would be greatly appreciated.

Thanks!

Brian
#2

[eluser]TheFuzzy0ne[/eluser]
You can use form_error() to set a class for your element if there is an error:

Code:
<label for="text" &lt;?php echo (form_error('text')) ? ' class="error"' : ''; ?&gt;>Text:</label><br />
&lt;input type="text" name="text" value="&lt;?php echo set_value('text'); ?&gt;" /&gt;
#3

[eluser]theQco[/eluser]
Perfect. That is exactly what I was looking for.

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB