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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:54:48+00:00 2026-05-27T04:54:48+00:00

I am trying to update multiple elements at once in a multidimensional array/object and

  • 0

I am trying to update multiple elements at once in a multidimensional array/object and having errors with .push and other options I have tried.

 var FEtypes= {
    textTemplate: {
       type :"Text",
       size : 50,
       required : "no",
       FEadd : '<input>', 
       label : 'Label',
       top : 0, 
       left : 0
    }, 
    textareaTemplate: {
       type : "Textarea",
       cols : 30,
       rows : 5,
       FEadd :'<textarea>' 
    }
 }

This works, but trying to do in one line.

 FEtypes[1].left = someVariable1;
 FEtypes[1].top = someVariable2;

I have been unsuccessful with:

 FEtypes[1].push( {left:someVariable1, top:someVariable2} );

I keep getting an error that this is not a function or it does nothing.

  • 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-27T04:54:49+00:00Added an answer on May 27, 2026 at 4:54 am

    FEtypes is an object, not an array. Push is only available on arrays.

    If you want to store this structure in an array, it would look something like:

    var FEtypes= [
          {type :"Text", size : 50,  required : "no", FEadd  :'<input>', label : 'Label', top : 0, left : 0}, 
          {type : "Textarea", cols : 30,  rows : 5,FEadd :'<textarea>' }
    ];
    

    Then

    FEtypes[1].left = someVariable1;
    FEtypes[1].top = someVariable2;
    

    If you want to modify multiple properties at once, the jQuery extend function will get you what you want:

    $.extend(FEtypes[1], {left:someVariable1, top:someVariable2});
    

    But I think your original structure is more suitable. Just ditch arrays, and do this:

    FEtypes.textareaTemplate.left = someVariable1;
    FEtypes.textareaTemplate.top = someVariable2;
    

    Or, again, with just one line with jQuery:

    $.extend(FEtypes.textareaTemplate, {left:someVariable1, top:someVariable2});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following SQL statement where i'm trying to update multiple rows matching
I am trying to update multiple rows on one table using MySQL. I have
So I'm trying to update an object in my MS SQL 2005 database using
I'm trying to update multiple rows in one table in MySQL database by doing
I'm trying to run one SQL command to update multiple databases. If I copy
I am trying to update multiple rows here.However I fail to point the right
I'm trying to use the AutoComplete feature of JQuery to update multiple fields on
I'm currently trying to update my in house search engine to use multiple words.
Hi: In my jsp page,I have a form to add/update a nested object using
I am basically just trying to update multiple values in my table. What would

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.