Welcome Guest, Not a member yet? Register   Sign In
Issue with form validation and page content restarting

Basically, I have my controller function for adding in my case a page but let's focus on the function:

public function add() {

  if ($this->form_validation->run() == TRUE) {
    // Form Validation
  $this->data['subview'] = 'blah blah';
  $this->load->view('blah blah.php', $this->data);

Basically when the form is submitted it will still unset the postID in this case, however i want to ensure that if the form is submitted and there are errors that this is missed and it doesn't redo some of my functions and variables. This is happening for a lot of my content when the form is submitted it re-initiates variables that i want to be ignored.

I also tried the following but it didn't work either:

if (!$this->form_validation->run() {

How do i avoid the entire page being redone with form validation?


Check for the submit button then you can change the form values that you want see the form_helper etc;
Use the set_value

Theme © iAndrew 2016 - Forum software by © MyBB