Skip to content

Instantly share code, notes, and snippets.

@eyalway2cu
Created July 8, 2020 06:09
Show Gist options
  • Select an option

  • Save eyalway2cu/c3241d7cd08d7f5e63c052d47f4e34af to your computer and use it in GitHub Desktop.

Select an option

Save eyalway2cu/c3241d7cd08d7f5e63c052d47f4e34af to your computer and use it in GitHub Desktop.
<script>
var query = document.location.hash
query = query.replace("#", "");
var qsarray = query.split("&");
var data = {};
for (i = 0; i < qsarray.length; i++) {
var itemarr = [];
itemarr = qsarray[i].split("=");
data[itemarr[0]] = itemarr[1];
}
document.querySelector("input#form-field-name").setAttribute("value", data.name);
document.querySelector("input#form-field-phone").setAttribute("value", data.phone);
document.querySelector("input#form-field-email").setAttribute("value", data.email);
document.querySelector("input#form-field-cc434e8").setAttribute("value", data.thum);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment