Search Tools Links Login

Request Form Sub


This code will help make your code more common, and provide simpler viewing for the Request.Form collection, by allowing the developer to place the entire Request.Form collection into a single Sub, therefore helping to organize your code a little better. We've all seen the type of code where Request.Form's are done many, many time throughout an ASP. It's hard to keep track of, right? Well, using this Sub will help you to organize your code, and your form collection.

Original Author: Matt Khoury

Inputs

Request.Form Collection

Returns

Request.Form Variables

Side Affects

None that I am aware of.

Code

<%
Dim strExample1, strExample2, strExample3
Call GetPostedItems(strExample1, strExample2, strExample3)
%>
If you want, here is where you can Response.Write
the variables to view the items in your collection:

<%
Response.Write "strExample1 = [" & strExample1 & "]
"
Response.Write "strExample2 = [" & strExample2 & "]
"
Response.Write "strExample3 = [" & strExample3 & "]
"
Sub GetPostedItems(ByRef strExample1, ByRef strExample2, _
ByRef strExample3)
'-- Enter the NAME of the field below.
strExample1 = Request.Form("Example1")
strExample2 = Request.Form("Example2")
strExample3 = Request.Form("Example3")
End Sub
%>

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 99 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.