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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:45:28+00:00 2026-06-03T02:45:28+00:00

I have new inputs for a multidimensional array. The original inputs that are already

  • 0

I have new inputs for a multidimensional array. The original inputs that are already defined are displayed correctly when called upon but the new inputs write as “undefined”. I think it is recognizing the new inputs as variables. How do you get them to show up as a string?

var original = new Array(); //this is the array
function input(title, artist, ddate, genre, picsrc) {
    this.Title = title;
    this.Artist = artist;
    this.Ddate = parseInt(parseFloat(ddate));
    this.Genre = genre;
    this.Picsrc = picsrc;
}
original[0] = {title:"Hope II", artist:"Gustav Klimt", ddate:1907, genre:"Art Nouveau", picsrc:"gustav.jpg"}; //and so on

Values that are added to the array are taken from a form.

function addit(form) {
G = form.Title.value //as a test

original[original.length++] =  new input(form.Title.value, form.Artist.value, form.Ddate.value, form.Genre.value, form.Picsrc.value)

alert("your entry has been added")
alert(G) //value shows up in the alert
}

but when it is called back in this function:

$("#info").html(original[currentrecord]["title"]+"<br /><h2>"+original[currentrecord]["artist"]+"</h2>"+original[currentrecord]["ddate"]+"<br />"+original[currentrecord]["genre"]);

everything is being written as “undefined”.
I am assuming that the data is successfully being added to the array, but maybe not in the right format?

  • 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-03T02:45:29+00:00Added an answer on June 3, 2026 at 2:45 am

    I prefer using dot notation, but it’s not a requirement.

    The real issue is: JavaScript is case sensetive.

    I would do it like this:

    original[currentrecord].Title
    original[currentrecord].Artist
    

    and so on…

    At one place in your code you are using all lowercase (when initializing original[0]), but in the constructor function you are using uppercase for the first letter.

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

Sidebar

Related Questions

i have made a function to add new upload and description inputs onClick. How
I have a dijit.form.NumberTextBox input field that starts out with these parms: new dijit.form.NumberTextBox({
When we have new in C#, that personally I see only as a workaround
I made a similar question a few days ago, but now I have new
I have the following line in my code: object[] inputs = new object[] {input1,
I have been told that scanf should not be used when user inputs a
I have a method that Inputs a text file from passed string, have to
I have a form with many inputs, but not all inputs must be filled
I have this unit test: public void testDeEscapeResponse() { final String[] inputs = new
I have found that certain inputs cause the iteration over the matches to 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.