Add an onsubmit
event listener on the form. Read the fields in the form using whichever way you are comfortable with. Now, as soon as the form is submitted, you can do something like following: (just an example, using jQuery-cookie)
$('#yourFormId .fieldClass').each(function() {
// a cookie that expires in 30 days.
$.cookie('somePrefix' + $(this).attr('id'), $(this).val(), {expires: 30});
});
On the next, page-load:
$(function() {
$('#yourFormId .fieldClass').each(function() {
var value = $.cookie('somePrefix' + $(this).attr('id'));
$(this).val(value);
});
});
Even better, whichever server-side language language you might be using, will allow you to access the cookie-values on the next page-load. So, you could directly fill-in the form-fields by using the cookies. For ex: if you are using PHP, you might do the following:
<input id="someId" value="<%php echo $_COOKIE['somePrefixsomeId']; %>" />
Although storing user-names or emails might be okay in such a way, please do not store any authentication information in cookies (such as passwords), or any other sensitive information (such as credit-card numbers).