Re: VB Script Problem

by "Andre Crane" <andre(at)terracrane.com>

 Date:  Thu, 15 Nov 2001 14:23:07 -0500
 To:  "Ted" <Ted.Lontine(at)mt3solutions.com>,
"hwg-languages" <hwg-languages(at)hwg.org>
 References:  pavilion
  todo: View Thread, Original
this should be:
--------------------
dim name()
redim name(4)  ' has 5 subscript values
FOR i =1 to 5
    name(i-1) = Request.form("name" & i)
NEXT
--------------------
OR this:
--------------------
dim name()
redim name(4) ' has 5 subscript values
FOR i =0 to 4
    name(i) = Request.form("name" & (i + 1))
NEXT
---------------------
because arrays always start with a subscript of 0.  Also, in the
request.form, you need to call the name of the form field,
("name" & i), what you were doing was calling a value of the current
iteration of the array.

Good luck,

Andre


> Hello all:
>
> I am trying to set up a registration form which can register multiple
names, addresses,
> etc. I want to send this form to be processed and values for the input to
be assigned. I
> am
> trying to grab these form values through the request.form collection
property, but I can't
> seem to make this function dynamic so I can read various form values. For
example:
>
> MY FORM 1 (input form)
> .....
> <form action="form2.asp" method="post">
> <.input type=text name="name1" size=20>
> ....
> <.input type=text name="name2" size=20>
> ....
> <.input type=text name="name3" size=20>
> ....
> etc.
> <./form>
>
>
> MY FORM 2
> .....
> .....
> dim name()
> redim name(5)
> FOR i =1 to 5
> name(i) = Request.form(name(i))
> NEXT
>


>
> This is where my problem lies. I cannot seem to dynamically change the
request.form
> property. Am I doing something wrong in syntax? Or is this not possible?
>
> TIA
>
> Ted L.
>
>
>
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA