This is tied to this question.
How can I dynamically add an HREF as a field is filled out?
I had success getting the link to work but it has been decided that the link would be better as a button. Here is what I have for the link.
The function I used
function buildPMLink(){
let urlStart = "https://www.projectmanagement.com?query=";
let urlEnd = "&showResults=False";
let campRef = document.getElementByID("campid").value;
let fullURL = urlStart + campRef + urlEnd;
document.getElementById('pmURL').href = fullURL;
}
The field that triggers the function
<div class="input-field col s3">
<input placeholder="Enter Campaign ID" id="campid" type="text" class="validate" oninput="buildWFLink(); buildPMLink();" required >
<label for="campaign_id">Campaign ID</label>
</div>
The link I added the dynamic HREF to.
<div >
<a id="pmURL">Test</a>
</div>
I tried creating a button and wrapping that in a form hoping to use the form action but failed. What am I missing?