Welcome Guest, Not a member yet? Register   Sign In
[Solved] - Problem in loading Validation Library
#3

[eluser]manilodisan[/eluser]
The validation should work as you have the code, however, try:

Code:
<?php
class Sample extends Controller
{
    //Constructor
    function Sample()
    {
        parent::Controller();
    }

    function index()
    {        
        //Set the validation rules
        $this->_loginFrmRules();
    }

    function _loginFrmRules()
    {
        //Load the required libraries.
        $this->load->library('validation');

        $rules['admin_name']        = 'trim|required';
        
        //Type 1 - Causes Error
        $this->validation->set_rules($rules);
        
        //Type 2 - Working Fine
        $this->get_instance()->validation->set_rules($rules);

        $fields['admin_name']        = 'Username';

        $this->validation->set_fields($fields);
    }
}
?>


Messages In This Thread
[Solved] - Problem in loading Validation Library - by El Forum - 10-16-2008, 09:44 AM
[Solved] - Problem in loading Validation Library - by El Forum - 10-17-2008, 04:30 PM
[Solved] - Problem in loading Validation Library - by El Forum - 10-17-2008, 06:01 PM
[Solved] - Problem in loading Validation Library - by El Forum - 11-06-2008, 12:05 PM
[Solved] - Problem in loading Validation Library - by El Forum - 08-18-2009, 10:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB