Welcome Guest, Not a member yet? Register   Sign In
Field name in form_error
#1

[eluser]sheldonnbbaker[/eluser]
Hey everyone,

Is there any way to change the error delims to get the field name in there as well?

E.g.,

Code:
<label for="cost">Cost</label>
&lt;input type="text" name="cost" value="{error}" class="text" id="cost" /&gt;

&lt;!-- Here....to get "cost" in the 'for' attribute' --&gt;
<label for="cost" class="error">There was an error....</label>
#2

[eluser]Colin Williams[/eluser]
Code:
&lt;?php echo form_error('cost', '<label for="cost" class="error">', '</label>'); ?&gt;
#3

[eluser]sheldonnbbaker[/eluser]
Ugh. Duh.

It's been a long day - thanks.




Theme © iAndrew 2016 - Forum software by © MyBB