Welcome Guest, Not a member yet? Register   Sign In
Problems with Callback Functions and Validation Class
#1

[eluser]mariowarner[/eluser]
Hi guys,

I've ran out of time, spent about 5 hours reading, debugging, reading, debugging but still haven't found any solution to my problem. I've used the code as stated on the user_guide about creating a callback function for a form validator but it just won't work on my server (although it did work on my local machine).

If you guys can try and check out the website [ http://www.floralstyle.biz/ ], I have a pre-launch registration form which accepts an email address (simple) and a captcha input. My validation code looks like this:

Code:
$rules['cinput'] = "required|callback_cinputCheck";
$rules['email'] = "required|valid_email";
$rules['confirm_email'] = "required|valid_email|matches[email]";


No problems with the email and confirm email code. I only have problems with the callback_cinputCheck. Below is the cinputCheck function:

Code:
function cinputCheck($str)
    {
        if ($str != $_SESSION["pass"]) // the correct value of captcha -> this validates ok,
                             // cos it doesn't proceed with the signup process
                              // successfully if you don't type the correct captcha.
        {
            $this->validation->set_message('cinputCheck', 'Incorrect Captcha characters.');
            return FALSE;                            
        }
        else
        {
            return TRUE;        
        }
    }

It's basically the same as the one on the user_guide's Validation Class (callback function). I just can't see why I keep getting the following error message when testing it online (while I don't get the same message offline):

Code:
Error(s):
Unable to access an error message corresponding to your field name.

Does it have to do with server configurations? Cos I did upload all the CI files in a zip file and extracted it on the server to avoid BINARY/ASCII file upload problems.

Any help will be greatly appreciated! Smile


Messages In This Thread
Problems with Callback Functions and Validation Class - by El Forum - 03-16-2008, 04:18 PM
Problems with Callback Functions and Validation Class - by El Forum - 03-16-2008, 08:22 PM
Problems with Callback Functions and Validation Class - by El Forum - 03-16-2008, 09:57 PM
Problems with Callback Functions and Validation Class - by El Forum - 03-16-2008, 10:16 PM
Problems with Callback Functions and Validation Class - by El Forum - 03-17-2008, 12:00 PM
Problems with Callback Functions and Validation Class - by El Forum - 03-17-2008, 01:31 PM
Problems with Callback Functions and Validation Class - by El Forum - 03-17-2008, 01:34 PM
Problems with Callback Functions and Validation Class - by El Forum - 03-18-2008, 04:46 AM
Problems with Callback Functions and Validation Class - by El Forum - 03-18-2008, 03:50 PM
Problems with Callback Functions and Validation Class - by El Forum - 04-14-2008, 03:40 PM
Problems with Callback Functions and Validation Class - by El Forum - 04-14-2008, 07:39 PM
Problems with Callback Functions and Validation Class - by El Forum - 06-16-2008, 09:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB