Skip to content

Instantly share code, notes, and snippets.

@antonioortegajr
Created July 8, 2016 23:14
Show Gist options
  • Save antonioortegajr/a5a5d591a212d3a54410338a458c7e92 to your computer and use it in GitHub Desktop.
Save antonioortegajr/a5a5d591a212d3a54410338a458c7e92 to your computer and use it in GitHub Desktop.
Add the url to a form
<html>
<head>
</head>
<body>
<form action="">
First name: <input type="text" name="fname"><br>
<input type="hidden" name="location">
<input type="submit" value="Submit">
</form>
<script>
var local = window.location.href;
document.getElementsByName('location').value = local;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment