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 May 13th, 2004, 09:30 PM
Authorized User
 
Join Date: Jun 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tp194
Default Form Elements into an Array

Hi

I have a form with two Text elements: Name & Title. This info will be sent to an Access database.

The user may need to enter more then one Name/Title, but can only add them one at a time. Rather then submitting each entry to the database individually, my thinking is to put them into an array, until the user has finished entering names...

I'm not sure how to get the form values into the array, and also because I don't know how many Name/Title entries the user could be entering, I'm not sure how to add new indexes to an array.

Any suggestions would be great.
Thanks

Terry

 
Old May 14th, 2004, 02:06 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Why dont you place multiple form name and title fields on the form so when they hit submit they all get posted at the same time?
Obviously you can loop thru the posted form fields detecting if they hold a value, is so insert.
OR
Do they go from page to page to page...and fill in details on each page? this is why you need ot store values? I would use hidden form variables, when they get to the end of the line you have all values from previous pages.

Or if you need to create an array not knowing how many elements you need, look up ReDim - it's fairly strait forward

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with array-type elements tclotworthy XSLT 2 October 11th, 2007 09:27 AM
Accessing elements of an Array object abdulqadirpk VB How-To 1 April 2nd, 2007 11:13 AM
Looping through form elements trekmp VS.NET 2002/2003 1 May 11th, 2004 11:01 AM
Add elements to array TSEROOGY Javascript 5 February 22nd, 2004 03:16 PM





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