///Dumping Form Information Onto a Web Page

Dumping Form Information Onto a Web Page

Dumping Form Information Onto a Web Page

There comes a time when you have to create very complex, very comprehensive online forms consisting of 30 to 40 fields. While debugging the form output, or while validating the individual form fields (for example, if all the fields have been filled), you need to dump all the form field with their names and with their respective values onto a web page so you can see exactly what is coming from where. This tutorial tells you how to do that.

Suppose we have the following form. To make the example shorter, I have not used many fields.

<form method=post action=showfields.asp>
<p>Name: <input type=text name="name" size=20><br>
Age: <input type=text name="age" size=20><br>
Location: <input type=text name="location" size=20><br>
Food: <input type=text name="food" size=20></p>
<input type=submit name="sub" value=Submit>
</form>

Now we write the code for the file showfields.asp

<%
For Each FieldVal in Request.Form()
Response.Write FieldVal & " -> " & Request.Form(FieldVal) &
"<br>"
Next
%>

2010-05-26T11:01:09+00:00 June 1st, 2005|ASP|0 Comments

About the Author:

Amrit Hallan is a freelance web developer. You can checkout his website at http://www.bytesworth.com. For more such articles join BYTESWORTH REACHOUT at http://www.bytesworth.com/br/default.asp or if you have a web dev related question then post it at http://www.business180.com/index.php

Leave A Comment