• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

189
Vistas
send post with list of id from html table for rows with checkbox property select using jquery

I have this table that is generated dynamically

HTML code for table

HTML table

I want to POST the list of id numbers of rows with selected checkbox.

I was able to get td elements selected using

        $('form#submit').submit(function(event) {
            $('#record_id tr').filter(':has(:checkbox:checked)').find('td').each(function() {
                console.log(this);
            });
            return false;
        });

I don't know how to build the list of id to send in POST.

almost 3 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I include table class to record_id table and use the following jquery code

        $('form#submit').submit(function(event) {
            var values = [];
            $('table > tbody input[type="checkbox"]:checked').each(function() {
                values.push(this.name);
            });
            console.log(values);
            $.ajax({
                type: "POST",
                url: "/systemlog",
                // The key needs to match your method's input parameter (case-sensitive).
                data: JSON.stringify({ logs: values }),
                contentType: "application/json; charset=utf-8",
                dataType: "json"
            });
            return false;
        });

enter image description here

almost 3 years ago · Santiago Trujillo 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda