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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:09:12+00:00 2026-06-06T03:09:12+00:00

I have a table with many rows and each row has select lists. Something

  • 0

I have a table with many rows and each row has select lists. Something like this:

| USER    | MANAGER            | DEPARTMENT   |

| Rob     | [John Smith |V]    | [Sales |V]   | 

| Sue     | [Bob Jones |V]     | [Support |V] |

The user is free to add new rows, there are many rows and the contents of the lists are complex.

I simplified things considerably by giving every manager selector id ‘manager’, and every department selector id ‘department’.

When the form is submitted, I wrote some javascript to cycle through each row, locate each row, and change the ids ‘manager_[rownumber]’ and ‘department_[rownumber]’.

And then I submit the form. My javascript code is below.

Based on debugging with alert popups, the ids are getting changed the way I want, but the servlet only ever receives one ‘manager’ parameter and one ‘department’ row number.

Why aren’t all the inputs (‘manager_1’, ‘manager_2’, and so on) getting submitted? Is there something I have to do after changing the ids to make sure the changes take effect before the submit of the form?

Thanks!

Rob

Here’s my code:

function submitForm() {
  correctInputIDs();
  document.myform.submit();
}

function correctInputIDs() {
  var rows = document.getElementsByTagName("tr");
  for (var i=0; i<rows.length; i++) {
    var row = rows[i];
    selectElements = rows.getElementsByTagName("select");
    for (var j=0; j<selectElements.length; j++) {
      var selectElement = selectElements[j];
      if (selectElement.id == "manager") {
        selectElement.id = "manager_"+i;
      }
      if (selectedElement.id == "department") {
        selectElement.id = "department_"+i;
      }
    }
  }
}
  • 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-06T03:09:13+00:00Added an answer on June 6, 2026 at 3:09 am

    Because IDs don’t matter with form submission, names do.

    Happy Reading

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this kind of table, it has many rows and each row has
In each table have many number of rows with amount. Like this i have
I have a table with multiple rows, each row has: layout (select) images *
I have a table style page with rows. Each row has a checkbox. I
Table (tbl_outside) has many rows. In each row is another table (class=tbl_Inside) which contains
I have a table of 50 odd rows with 11 columns. Each row has
I have a table, has many rows. for example one of from rows(all rows
I have a table, has many rows. for example one of from rows(all rows
I have a table with many rows of data, and I want to show
I have a table with many rows, is there any way to find out

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.