• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.