Just a quick one – If I were to have a link such as this (REST):
http://request.com/action.jsp?parameter={{insert}}
How would I add a little JavaScript to populate the param with text from a text field?
I will just have a small text box which I can enter something like ‘TRUE’ and when I hit a button it transforms the link to this:
http://request.com/action.jsp?paramter=TRUE
And executes the link.
What should I be using? I was thinking getElementByID will that work? Could I place all this in a and use the following code?
document.getElementById("htmlDiv").innerHTML = document.getElementById("htmlText").value;
But how would I place the value from the text box into my link, make that value a variable? Any helps appreciated, trying to learn JavaScript and do a project at work 🙂
Something like this should work: