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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:33:55+00:00 2026-06-17T12:33:55+00:00

Is it possible to put an Array values to a hidden input field? I

  • 0

Is it possible to put an Array values to a hidden input field?

I am using ASP Classic code with javascript.

I have this asp code that puts every content of an Array to my hidden field.

Dim Data

    For Each Data in aRecords(14)
        Response.write "<INPUT type='hidden' name='hdn_field' value=""" & Data & """>" 
    Next

It appears in the view source like this:

<INPUT type='hidden' name='hdn_field' value="arrayvalue1">
<INPUT type='hidden' name='hdn_field' value="arrayvalue2">

But when i try to get the value of the “hdn_field” via javascript code. It doesn’t work.

I call it by doing this (javascript):

testValue = document.frm_MainPage.hdn_field.value

I’m not sure if the mistake is in it’s way of assigning it to hidden field or by the way i call it in javascript.

Please help.

Your help will be greatly appreciated.

Thank you.

  • 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-17T12:33:56+00:00Added an answer on June 17, 2026 at 12:33 pm

    Because there are several hidden inputs with the same name, when you get the value of “hdn_field” you get all of those values in one go. To get only one value you need to give each hidden input a unique name.

    Try something like this:

    Dim length,i
    
    length=ubound(aRecords)
    
    for i=0 to length
        response.write "<INPUT type=""hidden"" name=""hdn_field" & i & """ value=""" & aRecords(i) & """>"
    next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a field in my database that has 5 possible values: fair, good,
Possible Duplicate: php values of one array to key of another array I have
Possible Duplicate: How do i Loop through the hidden field items and put in
Possible Duplicate: Java Remove Duplicates from an Array? String={3333,4444,5555,5555,1111} Using Delimiter i have put
Possible Duplicate: Access random item in list I have an array with numbers and
I have a character array like this : +---+---+---+ |53.|.7.|...| |6..|195|...| |.98|...|.6.| +---+---+---+ I
I have a huge array of ints that I need to sort. The catch
I want to change a values in byte array to put a long timestamp
Possible Duplicate: How to put string in array, split by new line? Is it
I'm trying to return all possible permutations of values in a String array. I've

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.