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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:08:02+00:00 2026-06-08T11:08:02+00:00

Okay, so what I have is basically three dynamic drop down boxes and a

  • 0

Okay, so what I have is basically three dynamic drop down boxes and a 2D array. I have each box adding their values together, and then I want the sum of the values to be searched for through the array to pull out the fifth value on whatever the row the value was on.

var shape = document.getElementById("shape").value;
var dimension_one = document.getElementById("dimension_One").value;
var x = 'x';
var dimension_two = document.getElementById("dimension_Two").value;
var selected_beam = shape + dimension_one + x + dimension_two; // combine all values from text boxes 
alert(selected_beam);

for (i = 0; i < array_shapes.length; i++)
{
    if (array_shapes[i][2] == selected_beam) {
        alert('Area=' + array_shapes[i][5]);
        //Area= array_shapes[i][5]);
    }
}

I know that selected _beam is giving me the value I want, and I also know that the array loop returns what I want out of the array but only if I replace

if (array_shapes[i][2] == selected_beam)

with

if (array_shapes[i][2] == "value I want to search for")

So what I really need to know is – why will it only accept it as a string and not as my selected_beam variable.

  • 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-08T11:08:04+00:00Added an answer on June 8, 2026 at 11:08 am

    Based on your array values, it looks like you need var x to be uppercase like:

    var x = 'X';
    

    If I am reading your array correctly, it also looks like the beam size is in element 0 and 1 of the array not 1 and 2, so you may need to not look for array_shapes[i][2], but rather array_shapes[i][0] or array_shapes[i][1]

    The first item in the array is at index value = 0.

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

Sidebar

Related Questions

Okay basically here's where I'm at. I have a list of PropertyDescriptor objects. These
Okay, basically, I have a large list of phone numbers in a text file
OKay, I will try to make this make sense lol. Basically I have 4
Okay, got a question. I have assembled a bit mask for options. Basically my
Okay, so basically lets say i have a matrix: matrix([[0, 1, 2, 3, 4],
Okay, so basically I have a Joomla site and a horizontal jQuery nav. I
Okay so basically, i have been trying this for and hour or 2 now.
Okay, I have a multi-dimensional array which is statically-allocated. I'd very much like to
Okay - I have a dilemma. So far my script converts page titles into
okay i have been trying to understand this for hours i am learning VB

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.