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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:40:26+00:00 2026-06-01T11:40:26+00:00

I am trying to get values from a data set. My function has to

  • 0

I am trying to get values from a data set. My function has to loop from 1 to 7
to get my opening hours for 7 days. what i need to do is:

Where openHours[i] the “i” stands for a number between 1 and 7. I would like to attach that number on the word “openHours” in order to create a new word ex. “openHours1”

What would be the best way to do that? The “alert(i);” is working fine and is generating numbers from 1 to 7. I just need to attach those numbers on the string.

So far i tried everything that can comes in my head but I don’t use javascript often so i am kind of stuck.

Thanks for the help.

function hoursFunction()
{  
var i =0;
alert("Hello");
for(i=1;i<8;i++)
{
    alert(i);
    alert(hoursForm.openHours[i].value);
}

}
  • 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-01T11:40:27+00:00Added an answer on June 1, 2026 at 11:40 am

    EDIT: After your comment, it would appear you are trying to get the following variable:

    alert(document.getElementById("openHours" + i).value);
    

    However, I would strongly consider using jQuery (or another library) to handle this, and you could do the following:

    $("#openHours" + i).val();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the values from a pointer to a float array, but
I'm trying to get the pixel rgb values from a 64 x 48 bit
I'm trying to get a json string back from my controller, that is prefill-values
So I am trying to get the e_values from the file
While i am trying to get value from arraylist,i got the following errors.My sample
i am trying to get the value from my methods and display it in
I'm trying to get the onreadystate value from the browser control do detect when
I'm trying to get a specific value from a mysql_fletch_assoc array. I explain. Here
I'm trying to get the returned value from a java method, but it returns
I am trying to set the data validation for a range of cells using

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.