I've been having some issues with this. All I want to do is save whatever the user types into the text input when they click submit even on refresh of page.
I have already tried localStorage, but that won't work because I want it to work with any browser. As in I can save the data on chrome, and go to IE and see that the form input values are still the same.
I have tried sending the form data via action POST, but how can I get that to KEEP the data after refresh? Right now I have it so it sends the data to a new page (that looks exactly the same) and can post the saved values in the input, but it doesn't stay there on refresh.
I also tried something called "sisyphus" but I couldn't even get that to work even though I already have jQuery installed. I used the exact example someone gave me, so if anyone can tell me why that didn't work, this might be the best solution.
Please help!
-
You need a server file/databasemplungjan– mplungjan2013年04月26日 09:41:44 +00:00Commented Apr 26, 2013 at 9:41
-
Try using session cookies.Mike– Mike2013年04月26日 09:42:27 +00:00Commented Apr 26, 2013 at 9:42
-
What's your IE version....??Prasath K– Prasath K2013年04月26日 09:42:50 +00:00Commented Apr 26, 2013 at 9:42
-
Wouldn't cookies only last for a certain amount of time?Josh Woelfel– Josh Woelfel2013年04月26日 09:45:24 +00:00Commented Apr 26, 2013 at 9:45
4 Answers 4
Since you want the data to persist across browsers/sessions, it sounds like you're going to need some kind of way to store that information, like a database or even a writeable file will do.
But secondly, you'll need a way to differentiate between users (some kind of login system), unless you want everyone who visits the form to see the inputs that the original person entered (like a google doc).
4 Comments
Start with using databases: http://www.freewebmasterhelp.com/tutorials/phpmysql/1
BEWARE: mysql_* functions in PHP are deprecated, use alternatives instead (you can find them on google)
I'm not sure if this is the answer to your question, your question was a bit unclear. I hope it helps!
6 Comments
If you want it to be for IE8+,then you can do it using localStorage with proper doctype
<!DOCTYPE html>
Comments
1.Store that value in session and retrieve and display it.
2.cookies