Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda