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.