0

Using CI&Bonfire setup input fields of my form don't clear on page refresh if I type something in them and then refresh the page. They only change if I manualy click the URL bar or restart the browser. This is becoming a nuisance as I need to populate form with new values on each refresh via controller.

This may be due to caching forms in views but I don't know where to turn it off?

Image: http://shrani.si/f/R/A9/266TebkQ/untitled.png

1 Answers1

0

You can manually set the server headers before outputting the final rendered display. It will solve the cache problem too.

You can set into the constructor.

$this->output->set_header("HTTP/1.0 200 OK");
$this->output->set_header("HTTP/1.1 200 OK");
$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
Jigar
  • 44
  • 4