Welcome Guest, Not a member yet? Register   Sign In
Form validation not running
#1

Hi all,

I'm trying to figure out why my form_validation_run function isn't returning true after I submit my form.

Here is my form:

Code:
<?php echo validation_errors(); ?>
   <?php echo form_open('admin/'.$section_data->name); ?>
   
   <textarea class="a"><?php echo $section_data->body; ?></textarea>
   
   <nav class="navbar navbar-default navbar-fixed-bottom">
       <div class="container">
           <button type="submit" class="btn btn-success navbar-btn navbar-right">Save</button>
           </form>
       </div>
   </nav>


And here is my Controller:
Code:
class Admin extends CI_Controller {
   
   public function __construct()
   {
       parent::__construct();
       $this->load->library('session');
       $this->load->helper('url');
       $this->load->model('section_model');
   }
   
   public function index($section = 'news')
   {
       $this->load->helper('form');
       $this->load->library('form_validation');
       
       $data['all_sections'] = $this->section_model->get_section();
       $data['section_data'] = $this->section_model->get_section($section);
       
       if ($this->form_validation->run() == FALSE) {
           $this->load->view('admin_home', $data);
       }
       else
       {
           $this->load->view('boom');
       }
   }


...

Everytime I submit the form, the admin_home view shows and not the boom view.

Any help appreciated, thanks.
Reply


Messages In This Thread
Form validation not running - by Domcsore - 12-29-2015, 01:29 AM
RE: Form validation not running - by pdthinh - 12-29-2015, 03:43 AM
RE: Form validation not running - by mwhitney - 12-29-2015, 10:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB