Welcome Guest, Not a member yet? Register   Sign In
validation problem
#1

[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;
        }
    }
    }
#2

[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?




Theme © iAndrew 2016 - Forum software by © MyBB