Sorry, I got that one wrong. Start over with a fresh formretain.js and add this at the top (addition red):
Code:
var memoryduration="100 days", flag=1
Then in about the middle of the function setformobjects() (addition red again):
Code:
if (retrievedvalues!=""&&flag){
Then change (at the end of the saveformvalues() function):
Code:
document.cookie = "mvalue"+window.location.pathname+"="+formvalues+"; path=/;expires=" + expireDate.toGMTString()
to:
Code:
document.cookie = "mvalue="+formvalues+"; path=/;expires=" + expireDate.toGMTString()
and change (about at the middle of the setformobjects() function):
Code:
var retrievedvalues=get_cookie("mvalue"+window.location.pathname)
to:
Code:
var retrievedvalues=get_cookie("mvalue")
Now, on our first page, use the script call in the head of the page as described in the demo and follow it with this script block, like so:
Code:
<script type="text/javascript" src="formretain.js">
/***********************************************
* Remember Form Values script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script type="text/javascript">
flag=0
</script>
On your second page, just use the script call in the head as in the demo.
Bookmarks