Cut & Paste Remember Text field values
This script can only remember the values of text fields (INPUT TYPE="text"), and not TEXTAREA, for example, since a cookie cannot store vast amounts of info.
Example: The first two fields' values will be remembered when you submit the form (try reloading the page afterwards).
Step 1: Cut and paste the below script into the <head> section of your page:
Step 2: With the script installed, simply modify your form with the parts in red:
<form onSubmit="rememberinput('yourname', 'youremail')"> Name:*<br /><input type="text" id="yourname" size="25" /><br /> Email Address:*<br /><input type="text" id="youremail" size="25" /><br /> Feedback:<br /> <textarea cols="25" rows="6"></textarea> <br /> <input type="submit" value="Submit" /> </form>
where "yourname", "youremail" etc are the IDs of the form input fields that you wish to remember. Enter as many fields as you wish (separated by a comma), though as mentioned, only text fields are allowed.