/* www.gibney.org entry nr. 214: PersistentFormdata */ /* www.gibney.org PersistentFormdata */ // // /* Script by Gibney-Enterprises include this script in a HTML-Page with a Form. Fill the form and press ctrl+shift+p to get a url for the current page with your values in input-fields and textareas */ ge_persistentFormdata_forms=Array(); function ge_persistentFormdata_KeyPress(e) { var code; if (!e) e = window.event; if (e.which) { code=e.which; } else { code=e.keyCode; } if (e.ctrlKey && e.shiftKey) { if(code==80) // 80=p as persistent { ge_persistentFormdata_MakePersistent() e.preventDefault(); } } } function isInArray(array, value) { for (var i=0; i0) parameters+='&'; // parameters+=form.elements[e].name; parameters+='gePF_'+f+'_'+e; parameters+='='; parameters+=encodeURIComponent(form.elements[e].value); } } window.location.hash=encodeURIComponent(parameters); } // 06.20.2010: // code to detect and read the legacy format using query-strings. // alerts the user, that an old URL was decoded and he should bookmark // the form again. // to be removed some day... function ge_persistentFormdata_LegacyCheck() { if (window.location.search.length>0) { var parameters=window.location.search.substr(1).split('&'); for (var p=0; p0) { parameters=window.location.search.substr(1).split('&'); parametercount=parameters.length; for (var p=0; p0) { var parameters=window.location.hash .substr(1) // remove # .replace(/%s/g,'%25s') // validate URL if Firefox placeholde %s is used .split('&'); // split to single parameters var parametercount=parameters.length; for (var p=0; p