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

[eluser]dimis[/eluser]
I use the validation class of the CI 1.7 but can not write the validation errors.
Code:
$this->load->library('form_validation');
        $name=array();
        $lancode=$this->lans->returnonlycode();
        foreach ($lancode as $lan=>$value)
        {
            $el=$value['lan_code'];
            $this->form_validation->set_rules("name_$el", "name_$el", 'required');
            $this->form_validation->set_rules("descr_$el","descr_$el", 'required');

        }
      
        if ($this->validation->run() == FALSE )
        {
            //the validation_errors() is empty
            $this->db_session->set_flashdata('prderror',  validation_errors());
            $this->db_session->set_flashdata('active', $this->input->post('active'));
            foreach ($lancode as $lan)
            {
                $this->db_session->set_flashdata("descr_".$lan['lan_code'], $this->input->post("descr_".$lan['lan_code']));
                $this->db_session->set_flashdata("name_".$lan['lan_code'], $this->input->post("name_".$lan['lan_code']));
            }
            redirect('manager/cats/newcat/','refresh');
        }
What is wrong.


Messages In This Thread
validation problem - by El Forum - 11-26-2008, 05:50 AM
validation problem - by El Forum - 11-26-2008, 06:02 AM
validation problem - by El Forum - 11-26-2008, 09:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB