My problem is similar to the link below: similar problem
I would like to send multiple values using form and javascript. Instead fixed value like code below:
<input type="hidden" name="Id[]" value="83" />
<input type="hidden" name="Id[]" value="85" />
I would like the value is based on user input. How can I achieve this?
I have other code to input user input
Link name: <input type='text' id='linkid'>
<button onclick="saveLink();return false">Save link</button>
And javascript code
var idarray=[];
function saveLink() {
var id = document.getElementById("linkid").value;
idarray.push(id);
}
How to send this idarray using html form?