So I have a list of items, on html page, in fact in form, something like this:
ITEM 1 - ID - "checkbox" "number box"
ITEM 2 - ID - "checkbox" "number box"
I have around 400 items like this, and I found a code to copy selected items (where checkbox is selected) to clipboard and paste them where I want. But I can't make it work with quantity. So basicaly what I would like to achieve is to copy selected items with quantity to clipboard. Can someone please help me about this problem?
<input type="button" id="prikaz" value="show" onclick="displayMaterial();" /> button for the script
<form id="myFrm" name="myFrm"> - form id
<div id="materialValues"></div> - this shows the selected item, where you can copy it
<ul id="myUL"> - ignore this this is just how i made a list
<li><span class="item"><div class=""><table><tr> <td> ARC 4012718 P2-HD-RXR-SA </td> <td> 160771 </td> <td> <input type="checkbox" id=" 160771 " name=" 160771 " value=" 160771 | ARC 4012718 P2-HD-RXR-SA "> </td> </tr></table></div></span></li>
this is just one item from my list
</ul>
and the code: (this is not my code, i found it somewhere and it works for this purpose, but I woud like to add quantity as well, but I don't have enaught knowledge to place part of the script that would handle that, somwhere around tha IF selected part.
<script type="text/javascript">
function displayMaterial()
{
var str = '';
var elem = document.getElementById('myFrm').elements;
for(var i = 0; i < elem.length; i++)
{
if(elem[i].checked)
str += elem[i].value +"<br>";
}
document.getElementById('materialValues').innerHTML = str;
}
</script>