[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
<?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();
?>
</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:
<?php echo $this->validation->errors(); ?>
tnx!