Welcome Guest, Not a member yet? Register   Sign In
Error : Callback fucntion is not getting called in New Version of CI 1.7.2
#1

[eluser]Amrish[/eluser]
Code:
function test() {
echo "hi"; exit;
}
function _validate_form() {    
    $this->load->library('Form_validation');
        $config = array(
               array(
                     'field'   => 'client_name',
                     'label'   => 'Client Name',
                     'rules'   => 'callback_test'
                  ),
               array(
                     'field'   => 'client_contact_person',
                     'label'   => 'Client Contact Person',
                     'rules'   => 'required'
                  ),
               array(
                     'field'   => 'client_address1',
                     'label'   => 'Client Address 1',
                     'rules'   => 'required'
                  ),
                 array(
                     'field'   => 'client_margin',
                     'label'   => 'Client Margin',
                     'rules'   => 'required|numeric'
                  )
                  
             );

        $this->form_validation->set_rules($config);    
        if($this->form_validation->run() == FALSE) {
            $this->error = validation_errors('<li>','</li>');
            return false;
        }
        else {
            return true;
        }
    }


I am using code for calling call back function but it is giving me error as

Code:
Fatal error: Call to undefined method CI::test() in C:\xampp\htdocs\vendor-tracking\www\system\libraries\Form_validation.php on line 589


Messages In This Thread
Error : Callback fucntion is not getting called in New Version of CI 1.7.2 - by El Forum - 04-26-2010, 10:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB