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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:08:29+00:00 2026-06-14T01:08:29+00:00

I am working on a Backbone app that requires the input of rows of

  • 0

I am working on a Backbone app that requires the input of rows of data (read: an array of objects).

I have the form set out like so:

<tr>
    <td><input type="text" name="items[][qty]"></td>
    <td><input type="text" name="items[][job_number]"></td>
    <td><input type="text" name="items[][description]"></td>
    <td><input type="text" name="items[][purchase_order]"></td>
</tr>
[...]

with a dynamic number of rows.

I want to be able to retrieve the data in the form of:

{
    items: [
        {
            qty: [val],
            job_number: [val],
            description: [val],
            purchase_order: [val]
        },
        [...]
    ]
}

The closest solution I have found is by Aaron Shafovaloff but it doesn’t support the arrays in the output (only objects). I could modify his code to do what I need but I figured I would ask here first since there is no point reinventing the wheel.

I am using jQuery and Underscore in my project so have access to their methods.

  • 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-14T01:08:30+00:00Added an answer on June 14, 2026 at 1:08 am

    I have mine this way to get multiple rows of text boxes:

        aItems = new Array();
        $("table tbody tr").each(function(){
            var $this = $(this);
    
            aItems.push({
                qty:$this.find('input[name="qty"]').val(),
                job_number: $this.find('input[name="job_number"]').val(),
                description:$this.find('input[name="description"]').val(),
                purchase_order:$this.find('input[name="purchase_order"]').val()
            });
    
        });
    

    how about this:

        aItems = new Array();
        $("table tbody tr").each(function(){
            var items = {};
    
            $(this).find('input').each(function(){
                items[$(this).attr('name')] = $(this).val();
            }
            aItems.push(items);
    
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with templates for a Backbone app that are stored in the HTML
I have a working app using Backbone 0.5.3, which is no longer working using
I am working on a javascript app with backbone.js, that said, for ease of
I am working on a single-page app using Backbone.js. An issue that has occurred
I'm working on an app that uses Backbone and RequireJS (using the Backbone boilerplate).
I'm working on my first large-scale Backbone/RequireJS app, and I have a simple question.
I'm working with backbone and lazy-loading both templates and data for one of my
I'm working on a backbone.js project and I'm calling my github repo. I have
I'm working with backbone+requirejs+jquery and I have a problem with jquery plugin loading in
I am working on a research project that deals with social networks. I have

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.