Welcome Guest, Not a member yet? Register   Sign In
Form validation on update
#6

[eluser]Tomer Simis[/eluser]
Ok guys, Im back. I've solved the problem Smile

Code:
function alterar(){
        
            if(!$this->uri->segment(3)){
                $data['titulo'] = 'BSS Direct - Alterar categoria';
                $data['categorias'] = $this->CategoriasModel->selectAll();
                $this->load->view('header',$data);
                $this->load->view('categorias/alterar');    
            }else{    
                $this->load->library('form_validation');
                $this->form_validation->set_message('required','O campo <strong> %s </strong> é obrigatório');
                $this->form_validation->set_error_delimiters('<li>', '</li>');
                
                $data['titulo'] = 'BSS Direct - Alterar categoria';
                $data['categoria'] = $this->CategoriasModel->selectDados($this->uri->segment(3));
                $this->load->view('header',$data);            
                
                    if($this->form_validation->run('categorias/alterar') == TRUE){
                        $this->load->view('categorias/alterar');
                    }else{
                        echo $this->input->post('nome');
                        $this->load->view('categorias/alterar_form');
                    }
            }
    }

I've put a parameter on the form validation and it worked, the "auto run on a config file" didn't work.

Cheers


Messages In This Thread
Form validation on update - by El Forum - 01-07-2010, 08:38 PM
Form validation on update - by El Forum - 01-07-2010, 09:32 PM
Form validation on update - by El Forum - 01-07-2010, 09:55 PM
Form validation on update - by El Forum - 01-07-2010, 10:03 PM
Form validation on update - by El Forum - 01-07-2010, 10:05 PM
Form validation on update - by El Forum - 01-08-2010, 11:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB