Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8105671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:13:24+00:00 2026-06-06T00:13:24+00:00

I have a table inside a form. It has two columns, the first one

  • 0

I have a table inside a form. It has two columns, the first one is a checkbox and the second is an input.

Here its structure:

<table>
<tr>
<td>
<input type="checkbox" name="choose" id="choose" class="choose">
</td>
<td>
<input type="text" name="item" id="item" class="item" >
</td>
</tr>
</table>

It is filled with info from my database so it may have several rows.

The form is submitted via a javascript function to a js file and then, thanks to jQuery’s ajax, all the parameters go to my controller php file.

As I want to send to my php all the values form the text input, in my js file I do:

       var arrayItem= [];
        $(".item").each(function(){
            arrayItem.push($(this).val());
        })
    params += '&items='+ arrayItem;
.
.
    //So I can do: 
        $.ajax ({
            url: myPHPUrl,
            data: params,
            type: "POST",
            async:false,
            success: function (data, textStatus)
            {   
            }
        });

Now I need to do the same with the checkboxes but I don’t know how to proceed.

Can anyone please help me with it?

Thanks very much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:13:26+00:00Added an answer on June 6, 2026 at 12:13 am

    You can try this:

       var arrayItem= [];
        $(".choose:checked").each(function(index, elem){
            //you could store them like a key-valuepair so you no where the value belongs to.
            //you can take the ID of the elem parm inside the for each and store it with the control id.
            arrayItem.push(elem.val());
        })
    params += '&items='+ arrayItem;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a html page that has a form, and a table inside
I have this form inside a table: <table id=fields> <form method=post id=accountform></form> <tbody><tr><td class=key>First
Basically I have two models: User and Godfather. The godfather table has three columns:
I have a table inside a form, which is populated with various input boxes.
I have a form with the fields inside table cells. On the last column
I have a div inside of a table which is inside of a form
i have table unser it i have one td with elemets inside the menu
I have two questions regarding to html table layout. First I will provide some
I have a small form inside a table. POSTing that form creates a new
I have a <form> tag, and inside is a table width td's, and inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.