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

181
Vistas
Click checkbox with jQuery

I'm building html dynamically with Ajax.

This code generates my table:

$(".row-info").append(`
    <div class="items_container ${value}" id="${value}">
        <div class="col-md-2 item_ref">${value}</div>
        <div class="col-md-6 item_description">${response[0].nombre}</div>
        <div class="col-md-3"><input type="number" class="form-control" value="1" style="width: 100%; text-align:center" /></div>
        <div class="col-md-1"><i class="fas fa-trash-alt fa-2x text-danger remove_line" style="cursor:pointer;"></i></div>
    </div>
`);

$(".remove_line").on("click", function () {
    $(".items_container." + value).remove();
    $("." + value).click();
});

enter image description here

This image it's result for my table created dynamically. I have a red trash image that if clicked it removes a line from the table.

I need to do that when I click remove checkbox checked, but when I clicked in this checkbox, change message.

I tried with: $('.'+value).click(); but my problem is that duplicate my entry in my table, always I can show my item selected. My message change, because detect when it's checked or not. But never remove my table line.

I don't know if have better solution to do this. And solve my problem.

Resume: when i click in checkbox "OFERTA" in left window, create iframe in right. When i check one checkbox in Iframes right I need create table resume in bottom.

Thanks for reading and sorry for my english.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

SOLUTION

$(".remove_line_"+value).on('click', function(){
                                        $(this).closest('.items_container').remove();    
                                        if($("."+value).prop('checked', true)){
                                            $("."+value).click();
                                            $("."+value).prop('checked', false);
                                        }
                                    });
about 4 years ago · Juan Pablo Isaza Denunciar
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