├── sup.min.js ├── LICENSE ├── sup.js └── README.md /sup.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | 1. Add a hidden form field for each URL parameter you’d like to capture. 3 | The field’s name should match the key of the URL parameter. 4 | 2. Include the script on the page(s) where you’d like to use it. 5 | Change queryForm() to queryForm({reset: true}) to reset values upon form submisision. 6 | */ 7 | 8 | var queryForm=function(e){var t=!(!e||!e.reset)&&e.reset,n=window.location.toString().split("?");if(n.length>1){var o=n[1].split("&");for(s in o){var r=o[s].split("=");(t||null===sessionStorage.getItem(r[0]))&&sessionStorage.setItem(r[0],decodeURIComponent(r[1]))}}for(var i=document.querySelectorAll("input[type=hidden], input[type=text]"),s=0;s