Welcome Guest, Not a member yet? Register   Sign In
On page refresh clear form values
#1

[eluser]Unknown[/eluser]
Input fields of my form don't change 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. And values change on ajax request. Not on form submit.

In short, how do I prevent Codeigniter from remembering values and instead display values from database on each page refresh.

Code:
<input name="uatitle" value="<?php echo $value->acontentdetail->title; ?>">

On refresh I would like to display data from my controller not the data I just typed in.
#2

[eluser]larsonator[/eluser]
Try echoing $value->acontentdetail->title stright out onto the page and see if the value is changing?

This sounds more like a caching issue than codeigniter.
You can add meta tags to tell the browser to not cache the page,

You other option would be to use jquery and use the onload event to clear the input. (this would be done when the page had finished loading, and $value->acontentdetail->title would also be cleared.
#3

[eluser]Unknown[/eluser]
Solved the problem by adding autocomplete="off" in input field. Seems like only Firefox saves form data on page refresh.




Theme © iAndrew 2016 - Forum software by © MyBB