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 8050783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:09:23+00:00 2026-06-05T07:09:23+00:00

I have an html table inside a form. This table is filled with information

  • 0

I have an html table inside a form.

This table is filled with information from my database.
This is how the table looks like:

<table>
<tr> 
<td >Number</td>
<td >Name</td>
<td >Last Name</td>
</tr> 
<tr> 
<td> <input type="hidden" id="number" value="1">1</td>
<td> <input type="hidden" id="name" value="John">John</td>
<td> <input type="hidden" id="last" value="Snow">Snow</td>
</tr> 
<tr> 
<td> <input type="hidden" id="number" value="2">2</td>
<td> <input type="hidden" id="name" value="Jean">Jean</td>
<td> <input type="hidden" id="last" value="Dow">Dow</td>
</tr> 
.
.
</table>

The number of rows the table has depends on the number of rows the database throws.

If the information is correct the user will hit the form’s submit button.

The submit button will take it to a function in a js file. From there, I need to get the values of the table and send them to a php file.

To achieve that, inside the function, in the js file I’m doing:

var sNumber = $("# number ").val();
 var sName = $("#name").val();
  var sLast = $("#last").val();
   params = '';
    params += '&number='+sNumber;
    params += '&name='+sName;   
    params += '&last='+sLast;   
     theUrl = 'controller.php';
   $.ajax ({
        url: theUrl,
        data: params,
        async:false,
        success: function (data, textStatus)
        {              
        }
    });

But as the ids of the rows in the table are identical I’m only getting the first row’s information.

Can anyone please help me to send all the information the table has to the php file?

Many thanks

  • 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-05T07:09:24+00:00Added an answer on June 5, 2026 at 7:09 am

    use class and do as :

    var listName = [];
    $(".name").each(function(){
        listNames.push($(this).val());
        alert($(this).val());
    })​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table inside a form that looks as follows: <td><input type=text name=code[0]
I have an html table in my webpage. It is filled with information from
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have an HTML table filled with a number of rows. How can I
I have a html page that looks like: <html> .. <form post=/products.hmlt ..> ..
So I have a html page that has a form, and a table inside
i have an html table inside a form in an asp.net mvc view. I
I have this form inside a table: <table id=fields> <form method=post id=accountform></form> <tbody><tr><td class=key>First
I have an html table of width 222px Inside in I have a single

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.