Skip to content

Instantly share code, notes, and snippets.

@matthewholliday
Created April 15, 2017 03:35
Show Gist options
  • Save matthewholliday/e6b3ef65c51ff65f01e126562d26fcac to your computer and use it in GitHub Desktop.
Save matthewholliday/e6b3ef65c51ff65f01e126562d26fcac to your computer and use it in GitHub Desktop.
concatenate hidden input value with url
<html>
<head>
<script type='text/javascript'>
function clickyClick() {
url = 'https://cei.org' + document.getElementById("contactid").value;
//cei.org used here for example
window.open(url, '_blank');
}
</script>
</head>
<body>
<!-- Use hidden input instead of form -->
<input type="hidden" name="contactid" id="contactid" value="%%fieldname%%"/>
<br>
<button onclick="clickyClick()">Get Link</button>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment