Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
copy form data to clipboard

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>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!