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

105
Views
Cómo mostrar la casilla de verificación marcada data-img en la lista

tengo este campo

<input class="red-heart-checkbox " name="photo[]" type="checkbox" value="<?php echo $id; ?>" id="<?php echo $id; ?>" data-img="<?php echo $imageURL; ?>"/>

Y me gustaría hacer una lista de imágenes con la imagen de URL de la imagen de data-img marcada, pero solo tengo valores con este código:

 <script> $(function() { var masterCheck = $("#masterCheck"); var listCheckItems = $("#devel-generate-content-form :checkbox"); masterCheck.on("click", function() { var isMasterChecked = $(this).is(":checked"); listCheckItems.prop("checked", isMasterChecked); getSelectedItems(); }); listCheckItems.on("change", function() { var totalItems = listCheckItems.length; var checkedItems = listCheckItems.filter(":checked").length; if (totalItems == checkedItems) { masterCheck.prop("indeterminate", false); masterCheck.prop("checked", true); } else if (checkedItems > 0 && checkedItems < totalItems) { masterCheck.prop("indeterminate", true); } else { masterCheck.prop("indeterminate", false); masterCheck.prop("checked", false); } getSelectedItems(); }); function getSelectedItems() { var getCheckedValues = []; getCheckedValues = []; listCheckItems.filter(":checked").each(function() { getCheckedValues.push($(this).val()); }); $("#selected-values").html(JSON.stringify(getCheckedValues)); } }); </script>

Mi resultado está en:

 <li class="list-group-item" id="selected-values"></li>

Y se ve así:

resultado del guion

¿Es posible tener una imagen de URL en lugar del valor, o usar el resultado con la base de datos para tener una imagen de URL?

Muchas gracias !

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Dos soluciones en mi opinión,

  1. El que ya sugirió, es decir, use una llamada db
  2. intente pasar imageURL en valor
about 4 years ago · Juan Pablo Isaza Report
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!