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

  • Home
  • SEARCH
  • 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 6130261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:50:15+00:00 2026-05-23T16:50:15+00:00

i just like to ask regarding adding data in a array. But the data

  • 0

i just like to ask regarding adding data in a array. But the data which i wanted to put is from a table of input boxes.. Here’s the code that i’ve been practicing to get data:

http://jsfiddle.net/yajeig/4Nr9m/69/

I have an add button that everytime I click that button, it will store data in my_data variable.

i want to produce an output in my variable something like this:

my_data  = [ {plank:"1",thickness:"4",width:"6",length:"8",qty:"1",brdFt:"16"}] 

and if i would add another data again, it will add in that variable and it be something like this:

my_data  = [ {plank:"1",thickness:"4",width:"6",length:"8",qty:"1",brdFt:"16"},
     {plank:"2",thickness:"5",width:"6",length:"2",qty:"1",brdFt:"50"}] 

the code that i have right now is really bad, so please help.

Currently my output:
1,4,6,4,1

  • 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-23T16:50:16+00:00Added an answer on May 23, 2026 at 4:50 pm

    You should be able to iterate over all of the textboxes using the following:

    function add(e) {
        var obj = {};
    
        $('#addItem input[type="text"]')
            .each(function(){obj[this.name] = this.value;});
        myItems.push(obj);
    }
    

    Where myItems is a global container for your items and #addItem is your form.

    Updated jsfiddle.

    If you use a form and a submit button then you should be able to implement a non-JavaScript method to add your information so that the site will be accessible to people without JavaScript enabled.

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

Sidebar

Related Questions

I'd just like to ask for some clarifications regarding the GPS functionalities of android
Just like Carl's question over here I would like to ask you (because I
It seems like Groovy was forgotten in this thread so I'll just ask the
I make a call just like this: value = ./simulated_annealing Which is a C
I would just like to ask what should be written in the Android.mk file
Just like it reads.
...just like packages do. I use Emacs (maybe, it can offer some kind of
Just like what happens when you click Sign in with OpenID on http://twitterfeed.com/ ,
Just like stackoverflow, there is a many-to-many relationship between Question and Tag. After running
Just like in JavaScript : opener.document.getElementByName jQuery: ?? Is there any way to get

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.