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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:39:26+00:00 2026-05-20T14:39:26+00:00

I have a project that requires the process of order entry. An order will

  • 0

I have a project that requires the process of order entry. An order will be as simple as choosing an item from a drop down list. Each order may contain multiple line items for the purchase. Using JQuery to clone this field is quite simple as I understand and I can get that far. Where I get hung up is there will be a collection of options relating to the item selected for the order that needs to be tied to that particular line item. A typical order may look something like:

  • PRODUCT ITEM: ASUS BASE DESKTOP
    • OPTIONS
    • 4GB RAM Option
    • Windows 7 x64 Professional
  • PRODUCT ITEM: HP BASE LAPTOP
    • OPTIONS
    • 2GB RAM Option
    • Windows Vista x32

My HTML markup looks something like:

<tr class="firstProduct productOrder">
    <td>Product Name</td>
    <td>
        <select id="ProductNameSelect" name="productOrdered[]">
            <option selected="selected" value="0">Select a Product...</option>
            <option value="1">ASUS BASE DESKTOP</option>
            <option value="2">HP BASE LAPTOP</option>
        </select>
    </td>
</tr>
<tr class="firstProduct productOrder">
    <td>Product Options</td>
    <td>
        <label>4GB RAM Option<input type="checkbox" name="productOption[0][]" value="1" /></label>
        <label>Windows 7 x64 Professional<input type="checkbox" name="productOption[0][]" value="2" /></label>
        <label>Windows Vista x32<input type="checkbox" name="productOption[0][]" value="3" /></label>
    </td>
</tr>

The name of the productOption fields have to be named to a nested array or else options selected for productOrdered[1] may not get properly assigned. I need the ability to iterate the name of the productOption from [0][ ] to [1][ ] to [2][ ] and so on for each order added so it can be processed properly in the POST variable for PHP.

Is there a “best method” or at least more common method for accomplishing this goal other than to search for the previous child in JQuery and the parse the name to determine the next ID to be used in the name for productOption?

  • 1 1 Answer
  • 1 View
  • 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-20T14:39:27+00:00Added an answer on May 20, 2026 at 2:39 pm

    Yes, simply declare a global variable in your javascript code and increment it everytime you add a fieldset.

    <script>
    var index=0;
    function addFieldset()
    {
       ...
       index++;
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that requires the following. Four arrays will be declared in
I have a project that requires me to process a lot (1000-10000) of big
I have a project that requires some configuration files. I want to keep the
We have an old project that requires occasional maintenance that uses VS2003 and Dot
We have a large MS Access project that requires GUI functionality that is difficult
I have a spec in my current project that requires us to advise the
I have recently just created Java project using Eclipse that requires 2 JAR files
$(.container).hover( function(){ $(.child-1).hide(0); $(.child-2).show(0); },function(){ $(.child-1).show(0); $(.child-2).hide(0); }); A project I have requires that
I have a project in mind that will require the majority of queries to
We have a Silverlight 2 project (game) that will require a lot of character

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.