This seems to be working for me.
================================
// 11-28-04 - one thing I hate is when I write a long email using a
service like Hotmail, then
// I hit submit, and then I lose everything I wrote because while I
was writing the email
// I unknowingly lost my internet connection. So now we are
offering this mild protection,
// which is to gather the text of the form and output it to t
separate window.
function openInNewWindowString(windowText) {
var docWindow = window.open('', 'userSubmission',
'width=300,height=300,status=true,scrollbars=true,resizable=true,toolbar=true');
docWindow.document.write(windowText);
docWindow.focus();
return false;
}
function saveYourWork() {
var elem = document.forms[0].elements,
temp = ['<h1>Please save your work!!!<\/h1>'];
for(var i = 0, n = elem.length; i < n; ++i) {
temp[temp.length] = elem.name;
temp[temp.length] = ': ';
temp[temp.length] = elem.value;
temp[temp.length] = '<hr>';
}
openInNewWindowString(temp.join(''));
}