I would like to send multiple value using javascript and form
Multi tool useClash Royale CLAN TAG#URR8PPP
I would like to send multiple value using javascript and form
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?
input
<input type="hidden" name="Id" value="83,85,70" />
and then you can split it in js and/or server side .– Ashraf
7 mins ago
<input type="hidden" name="Id" value="83,85,70" />
@Ashraf I want the value input by user. I have add more detail to my problem.
– roscoe_x
5 mins ago
But how are you sending the data and to what file format? Are you using a default
form
POST action or using AJAX
?– NewToJS
2 mins ago
form
AJAX
1 Answer
1
Assign the id to hidden
element and set the value
to this element before form submit
hidden
value
form submit
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
How can the user input if the
input
s are hidden and how would you like to send the data and what would you like to send it to? Too much relevant information is missing from your question description– NewToJS
17 mins ago