CI: clearing form after successful submit


/ Published in: PHP
Save to your folder(s)

Within your view, you place something like:



Copy this code and paste it in your HTML
  1. if ($this->form_validation->run() === TRUE)
  2. {
  3. // save data
  4.  
  5. $this->session->set_flashdata('message', 'New Contact has been added');
  6. redirect(current_url());
  7. }
  8.  
  9. $this->load->view('contacts/add', $this->data);

URL: http://stackoverflow.com/questions/2802046/codeigniter-form-validation-how-to-unset-form-values-after-success

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.