Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need field names from Form collection not just values

Status
Not open for further replies.

lamarw

MIS
Dec 18, 2002
223
0
0
US
Hello again,
I've tried looking for some help on looping through a form collection for field names. I found something that gets values of the form collection but I need field names as well. I've also looked at the FormMail.asp which actually does this but when I duplicate there code(no real trick) I get the values not the field names. Any suggestions?
At the top of the form Response.buffer is set to True. Does that impact what I'm trying to do?

This is the FormMail.asp code:
for i = 1 to Request.Form.Count
for each name in Request.Form
if Left(name, 1) <> "_" and Request.Form(name) is Request.Form(i) then
if str <> "" then
str = str & ","
end if
str = str & name
exit for
end if
next
next

My simple test code is as follows:

for i=1 to Request.Form.Count
for each Name in Request.Form
Response.Write Request.Form(Name) & "<BR>"
next
next
As I said I get values but no names.

Lamar
 
*sheepishly*
I found my mistake, he he, If I just response.write Name I get what I needed...

Thanks anyway

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top