CodeIgniter Forums

Full Version: validation problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]dimis[/eluser]
I have a validation rule that it does not work.
I wrote a callback function that is never running, what is wrong?
The code is
Code:
$this->load->library('form_validation');
        $this->form_validation->set_rules('cart_name', 'name', 'required', 'callback_check_text');
....
function check_text($str)
    {
        $a=$_POST['FCKEDITOR1'];
        $b=$_POST['FCKEDITOR2'];
        die(empty($a));
        if (empty($a)  || empty($b))
        {
            $this->form_validation->set_message('cart_name', 'Description and text must not be empty');
            return FALSE;
        }
        else
        {
            return TRUE;
        }
    }
    }

El Forum

[eluser]Colin Williams[/eluser]
Is your check_text function actually a method of your controller? Or did you nest it an another method and expect that to work?