Is it possible to store the value of a textarea (i.e. what's written in it) or other form elements so that they do not "disappear" if the page is refreshed?
I don't know if this is out of the scope of this forum, but do you think there might be a way to implement this using a combination of JS and PHP? I'm not sure I want to go with cookies.
You can submit data to the server by a number of common gateway interface mechanisms (i.e. QUERY_STRING, POST_DATA, PATH_INFO) but I don't think these will work with a page refresh.
Me neither believe that query string will work at refreshing the page.]
But with refresh you could redirect the use to the same page, adding the query strings.
If the textarea is empty, it will remain empty, else its value will be the retrieved string.
The only way to do what you have asked over a page refresh, with any degree of cross-browser compatibility, is using cookies (with a solution like the one Glen gave).
As you are refreshing the page, not submitting a form, then PHP / form code will be useless.
This, of course, assumes you meant "refresh" instead of "submit" (i.e. the user presses their refresh button). This also assumes that their browser will support the onunload or onbeforeunload events. If they do not, there isn't really any way you will manage this.
Dan
[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.