Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda