[eluser]Michael Wales[/eluser]
On most all of my forms, I use the same controller for displaying and processing the data, redirecting away upon success.
Code:
$this->load->library('validation');
// My Rules
// My Fields
if ($this->validation->run()) {
// Perform my database shizzle
redirect('view_this_data');
} else {
$this->load->view('display_input_form');
}
A refresh in these circumstances would simply refresh the displayed data.
If you are wanting to load a blank form up again, you could always just toss a middle-man in there, like so:
Code:
$this->load->library('validation');
// My Rules
// My Fields
if ($this->validation->run()) {
// Perform my database shizzle
$this->session->set_flashdata('return_path', $this->uri->uri_string());
redirect('clear_post');
} else {
$this->load->view('display_input_form');
}
function clear_post() {
redirect($this->session->flashdata('return_path'));
}
Kind of a round-about way...