Welcome Guest, Not a member yet? Register   Sign In
Form validation & view within a one function
#2

The documentation about form validation has this example:

PHP Code:
public function new_vehicle()
{
        
$this->load->helper(array('form''url'));

        
$this->load->library('form_validation');

        if (
$this->form_validation->run() == FALSE)
        {
                
$this->load->view('myform');
        }
        else
        {
                
$this->load->view('formsuccess');
        }

This way, the form is shown if you call the new_vehicle method from your site's navigation, but also if the form doesn't validate because of errors.
Reply


Messages In This Thread
RE: Form validation & view within a one function - by Wouter60 - 08-02-2016, 08:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB