gibney.org
:
Technology
:
Javascript
:
Includes
:
PersistentFormdata
:
PersistentFormdata
search:
See as:
raw
|
code
terms of service
|
imprint
gibney.org
is powered by
m1d1
PersistentFormdata
(Entry Nr. 214, by user 39 |
edit
)
/* 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; i
0) 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; p
0) { parameters=window.location.search.substr(1).split('&'); parametercount=parameters.length; for (var p=0; p
0) { var parameters=window.location.hash .substr(1) // remove # .replace(/%s/g,'%25s'); // validate hash if Firefox placeholder %s is used if(parameters.indexOf("=")==-1) // false if hash is already decoded (FF does so) parameters=decodeURIComponent(parameters); parameters=parameters.split('&'); // split to single parameters var parametercount=parameters.length; for (var p=0; p
Create a new entry at this position