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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:43:21+00:00 2026-05-25T17:43:21+00:00

I have a form with elements like: <div class=row1> <select name=someSelectField multiple=multiple class=selectList> <option

  • 0

I have a form with elements like:

<div class="row1">
   <select name="someSelectField" multiple="multiple" class="selectList">
      <option value="1">1</option>          
      <option value="2">2</option>          
   </select>
   <input type="checkbox" name="checkboxField" class="checkboxField" value="1" /> checkbox</td>
</div>
<div class="row2">
   <select name="someSelectField" multiple="multiple" class="selectList">
      <option value="1">1</option>          
      <option value="2">2</option>          
   </select>
   <input type="checkbox" name="checkboxField" class="checkboxField" value="1" /> checkbox</td>
</div>

These will continue down the page. With lots of different rows of these same fields. There is no set rows as javascript is used to create more rows.

My question is, what should the value of each name attribute be, so that it stays grouped as arrays and can be referenced together? For example, if I use someSelectField[1], when the method is GET, the form sends it like someSelectField[1]=1&someSelectfield[1]=2 (if both are selected). I am looking for it to be someSelectField=1&someSelectfield=2, etc.

Any help would be appreciated. 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-05-25T17:43:21+00:00Added an answer on May 25, 2026 at 5:43 pm

    Why don’t you just give the controls unique names? If your javascript is capable of giving the divs indexed class names, you could just restructure the html as so:

    <div class="row1">
       <select name="someSelectField1" multiple="multiple" class="selectList">
          <option value="1">1</option>          
          <option value="2">2</option>          
       </select>
       <input type="checkbox" name="checkboxField1" class="checkboxField" value="1" /> checkbox</td>
    </div>
    <div class="row2">
       <select name="someSelectField2" multiple="multiple" class="selectList">
          <option value="1">1</option>          
          <option value="2">2</option>          
       </select>
       <input type="checkbox" name="checkboxField2" class="checkboxField" value="1" /> checkbox</td>
    </div>
    

    This has the benefit of being server independent too since some frameworks parse html arrays really well and give you a proper array, and some just overwrite keys.

    Your parsing might get a little messy on the back-end if you’re allowed to remove elements from the middle instead of just from the end but it shouldn’t be too bad. And if that is a concern you could write a simple jQuery script that would line all your names up again. Warning, untested code follows:

    $("div[class^='row']").each(function(idx, value) {
        var $value = $(value);
        $value.find(".selectList").attr("name", "someSelectField"+(idx+1));
        $value.find(".checkboxField").attr("name", "checkboxField"+(idx+1));
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a form with multiple div elements like this <div> <label for=id>text</label> <input
Suppose to have a code like this: <div class=notSelected> <label>Name <input type=text name=name id=name
I've got a simple form like so (illustrative purposes only)... <form> <div class=input-row> <label>Name</label>
I have an Element Like <div class=control> <label>&nbsp;</label> <input type=checkbox id=1><span class=controlText>Check Box</span> <div
Lets say I have CSS like this: div.form label input { /* some css
Please help! I have some form elements in a div on a page: <div
I have an input field that is rendered with a template like so: <div
I have about 6 div elements with the same class. When I mouseover any
I have a block of form elements which I would like to clone and
I have a register form created by mvc3 scaffolding. e.g. <div class=editor-label> @Html.LabelFor(model =>

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.