Field Grabber
Posted: 2002-06-01
By: ArchiveBot
Viewed: 101
Filed Under:
No attachments for this post
Have you ever gotten fat-fingered when trying to get the fields from a "Post" action and scrathed your head trying to figure out where the mistake is? Or pondered over a field input page, trying to figure out all the fields you have so you can add those fields to your request.form statements?
This code eliminates these problems. It grabs the field names and the formats the output in a copy-and-pasteable format so you can spend more time creating and less time trouble-shooting.
Original Author: Brian S. Vinson
Assumptions
Fieldgrabber.asp - a simple, time saving utility.
Create a file named fieldgrabber.asp and paste in this code.
On a form page where you are submitting, make the action
fieldgrabber.asp and the method post. All the field field names
will print out in a copy-and-paste ready format.
Paste the results into the actual page you want to gather
your form info, change the action back to the actual page,
and you're ready.
Returns
All the field names from an input page.
Code
<%
For Each Item in Request.Form
For iCount = 1 to Request.Form(Item).Count
if Request.Form(Item)(iCount) <> "" then
response.write Item & "=request.form("" & Item & "")
"
End if
Next
Next
%>
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.