Welcome Guest, Not a member yet? Register   Sign In
form_error not displaying when id applied
#1

[eluser]debow[/eluser]
Hello all,

Can someone please help with with the issue I'm having when trying to build a form and apply the css from a free template I've found. This issue is when I build the form and submit it with empty fields that are required it doesn't show the error. Below is the code.

Code:
<fieldset>
        &lt;?php $form_att = array('id'=>'contact'); ?&gt;
        &lt;?php echo form_open('contact/add', $form_att); ?&gt;

      
        <label for="conFirst">First name: *</label>
        &lt;?php echo form_input('conFirst', set_value('conFirst')) ?&gt;
        &lt;?php echo form_error('conFirst'); ?&gt;

However if I try this, my errors display but the css around the form/fieldset is gone.

Code:
<fieldset>
        &lt;?php echo form_open('contact/add'); ?&gt;

        <label for="conFirst">First name: *</label>
        &lt;?php echo form_input('conFirst', set_value('conFirst')) ?&gt;
        &lt;?php echo form_error('conFirst'); ?&gt;

Thanks
#2

[eluser]Sudz[/eluser]
Have you set your form validation rules and error message?
Post your controller.
#3

[eluser]debow[/eluser]
Yes, again everything shows just find when I don't try to apply the css setup for forms. But if I remove that my fields are all over the place but the validation errors show up.




Theme © iAndrew 2016 - Forum software by © MyBB