So essentially, I have an input and I want to modify the value before the user submits it. All I want to do is add a string to the end of this inputs value. I thought it would be something like:
<form action="myURL" onsubmit="myFunction" method="POST">
<input id="myID" value="someValue" />
<button type="submit">Press Me!</button>
</form>
<script>
myFunction()
{
var x = document.getElementById("myID").value;
document.getElementById("myID").value = x + "myString";
}
</script>
However, when the form is submitted the appended string is not sent and only the original string makes it. Does anyone know why this is happening?