CodeIgniter Forums
validation->PHP error was encountered - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: validation->PHP error was encountered (/thread-44955.html)



validation->PHP error was encountered - El Forum - 09-01-2011

[eluser]Near[/eluser]
hi when i run validation i encountered this error..

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_Loader::$validation

Filename: core/Loader.php(679) : eval()'d code

Line Number: 2


my view
Code:
<div id="add" style="display:none;"> //triggered by jQuery
&lt;?php
echo form_open('admin/validateAddEmp');
echo form_input('id');
echo br(2);
echo form_input('name');
echo br(2);
echo form_input('designation');
echo br(2);
echo form_input('address');
echo br(2);
echo form_input('contact');
echo br(2);
echo form_input('email');
echo br(2);
echo form_password('password');
echo br(2);
echo form_password('password2');
echo br(2);
echo form_submit('','submit');
echo form_close();
?&gt;
</div>

my Controller

Code:
function validateAddEmp()
    {
        $chkQuery = $this->dashboard_model->validateInfo();
        if($chkQuery)
        {
            $this->load->library('form_validation');
            
            $this->form_validation->set_rules('name','name','trim');
            $this->form_validation->set_rules('email','E-mail Address','trim|valid_email');
            $this->form_validation->set_rules('password','Password','trim|min_lenght[4]');
            $this->form_validation->set_rules('password2','Password confirmation','trim|min_lenght[4]|matches[password]');
            
                $this->load->helper(array('form', 'url'));

                if ($this->form_validation->run() == FALSE)
                {
                    $this->load->view('/admin/employee/empError');
                }
                else
                {
                    echo "OK";
                }

        }
    }

error Page
Code:
&lt;?php echo $this->validation->errors(); ?&gt;

tnx!