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