Click to See Complete Forum and Search --> : Request.form variable


jacknbey
01-04-2005, 03:11 AM
Hi,

I would like to use the request.form function to retrieve a POSTED data.

The issue is that the KEY of the POSTED data is an variable.

Normally you see this:-

value = request.form("FirstName")

in my case you will see this:-

DIM Firstname
value = request.form(FirstName)

won't work because FirstName is a variable

How can I make it work?


Regards.

russell
01-04-2005, 11:42 AM
you have to know the name to get the specific form value. however, you can get 'em all like this

Dim f
For Each f In Request.Form
Response.Write f & Request.Form(f)
Next

Now, if you knw a partial name, say maybe you know the form element will be named something like "item_x" where x is the unknown part

For Each f In Request.Form
If Left(f, 5) = "item_" Then
Response.Write f & Request.Form(f)
End f
Next

jacknbey
01-04-2005, 12:01 PM
Thanks Russell,

Works well.

Regards.