Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2004, 05:11 PM
Registered User
 
Join Date: Jul 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default assinging variables to an array

hello,
Am using VB script and need solutions

THREE PROBLEMS:
1. Picking variables from a dynamic generated form
2. Assigning variables to an array
3. Create a repeated region for the array

i have an array as
dim afrika(6)

I would want to be able to assign variables to the array, based on form variables from a form.

Now, the form that would pass the variables generates dynamic form elements.
How could i:

1. Get all the values from the dynamic form
2. Assign them to an array
3. Create a repeated region for the array(s). Using

for each
response.write(array(0))
next

I am currently trying the script below, but doesnt seem to work

a=0
for each item in request.form
arrayMe(a) = request.form(item)
a = a+1
next

for a = 0 to Ubound(arrayMe)
response.write arrayMe(a)
next


Any Advice ?
thanks



 
Old September 15th, 2004, 08:09 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

hello,

   First, you store all the form data to a string variable with any delimiter.


for each item in request.form
  strVar=strVar & request.form(item) & ","
next

arrMe=split(strVar,",") 'split the string into an array with the specified delimiter

for j=0 to ubound(arrMe)-1
  response.write arrMe(j)
next


Rajani






Similar Threads
Thread Thread Starter Forum Replies Last Post
Convering a String Array to an Integer array nkrust C# 9 November 17th, 2010 12:02 PM
Go from 2d Array to 1d array without defining type OneQuestion General .NET 1 January 10th, 2008 11:13 AM
Pass variables from array inside a loop dustygn PHP How-To 2 May 3rd, 2006 05:35 PM
error when sorting an Array of Array nancy VBScript 2 February 17th, 2005 12:57 PM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.