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

330
Views
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.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

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

about 4 years ago · Santiago Trujillo 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!