Welcome Guest, Not a member yet? Register   Sign In
MY_Form_validation problem
#3

[eluser]brixxster[/eluser]
Thanks for the reply Nick, I have checked the filenames and it is following the guide guides you mention above. Here's the snippet of the "application/libraries/MY_Form_validation.php"


Code:
class MY_Form_validation extends CI_Form_validation {

    function __construct()
    {
        parent::CI_Form_validation();
    }
    
    function set_rules($field, $label = '', $rules = '')
    {
        if(count($_POST)===0 AND count($_FILES) > 0)//it will prevent the form_validation from working
        {
            //add a dummy $_POST
            $_POST['DUMMY_ITEM'] = '';
            parent::set_rules($field,$label,$rules);
            unset($_POST['DUMMY_ITEM']);
        }
        else
        {
            //we are safe just run as is
            parent::set_rules($field,$label,$rules);
        }    
    }
....

and I am calling it in my controller like this..
Code:
$this->load->library('my_form_validation');

It's strange... please help.


Messages In This Thread
MY_Form_validation problem - by El Forum - 09-06-2010, 01:36 PM
MY_Form_validation problem - by El Forum - 09-06-2010, 01:57 PM
MY_Form_validation problem - by El Forum - 09-06-2010, 02:37 PM
MY_Form_validation problem - by El Forum - 09-06-2010, 02:50 PM
MY_Form_validation problem - by El Forum - 09-06-2010, 03:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB