Welcome Guest, Not a member yet? Register   Sign In
Calling a controller after validation error
#2

[eluser]xwero[/eluser]
I'm not sure how your code looks like but if you put your view calls in the method you can do
Code:
function page()
{
   $this->load->view('header');
   if(count($_POST) > 0)
   {
       $this->load->library('validation')
       // rules
       if(!$this->validation->run())
       {
            $this->load->view('errorform');
       }
       else
       {
            $this->load->view('successform');
       }
   }
   else
   {
       $this->load->view('form');
   }
   $this->load->view('header');
}
If you don't use other views but display the information in the same form you only have to change the content of the second parameter in the view method that displays the form.


Messages In This Thread
Calling a controller after validation error - by El Forum - 02-25-2008, 11:30 PM
Calling a controller after validation error - by El Forum - 02-26-2008, 02:15 AM
Calling a controller after validation error - by El Forum - 02-26-2008, 03:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB