473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

forms collection and for next

I'm trying out some code cause of an idea I just got, but it won't work
for each item in Request.Form
Response.Write (Request.Form("item"))
Response.Write("<br>")
next
only one <br> per Request.Form("item") appears on the page, but no item
in Request.Form is written.
However I've learnt that "You can iterate through a collection using a
For Each item in ... Next loop."

Mats


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
2 2301
Mats wrote:
I'm trying out some code cause of an idea I just got, but it won't
work for each item in Request.Form
Response.Write (Request.Form("item"))


You just told it to write the contents of a variable called "item". I doubt
there is a variable with that name in your Forms collection.

What you really wanted it to do was write the contents of the variable whose
name is contained in the item variable. Like this*:

Response.Write Request.Form(item)

* You should not use the parentheses around the response.write argument -
the Write method does not return a value, so the parentheses are not needed
unless you are doing this in jscript.

HTH,
Bob Barrows


Jul 19 '05 #2
Mats wrote on 20 sep 2003 in microsoft.public.inetserver.asp.general:
I'm trying out some code cause of an idea I just got, but it won't work
for each item in Request.Form
Response.Write (Request.Form("item"))
Response.Write("<br>")
next
only one <br> per Request.Form("item") appears on the page, but no item
in Request.Form is written.
However I've learnt that "You can iterate through a collection using a
For Each item in ... Next loop."


<%
for each item in Request.form
Response.Write item & " = " & Request.form(item) & "<br>"
next
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mats | last post by:
Hi Is there a way to manipulate (ie change) the items in the forms collection. I simply want to get rid of the infamous apostrophe in input from a form, replace ' with ''. I had hoped to be able...
4
by: Soryt | last post by:
Hi everyone ! 1) An example from help: "Each Form object has a Controls collection, which contains all controls on the form. You can refer to a control on a form either by implicitly or...
4
by: sparks | last post by:
OK we have it so we can use tables to define skip patterns on our forms. BUT we can only do one form. Public Function skipPattern(currentFrm As Form, Optional currentCtl As Control = Null) As...
4
by: MLH | last post by:
I would like to change ShortcutMenu property setting to No for all forms - permanently. I tried this code... Private Sub Command0_Click() Dim frm As Form, ctl As Control For Each frm In Forms...
3
by: K.K. | last post by:
Hi all, I just have a small vb6 upgraded to dot net and now I'm fixing the problem according to the upgrade report. Most of them are easily fixed except one I'm not quite sure ... I have a...
2
by: Yuk Tang | last post by:
I have created my own custom forms called baseform, inheriting normal form properties and such. Baseform is, as can be expected, the basis for the other forms in my project. I want to close all...
2
by: MLH | last post by:
I would like to populate a table with the following information: tblPropertySettings - the GotFocus property setting string - the LostFocus property setting string I'd like to document...
15
by: c676228 | last post by:
Hi all, In traditional asp form, there is an action field in a form, any time the page is valid, after click the submit button, the next page comes up based on the value in the action field. In...
11
by: Kevin | last post by:
I've got a timer on my MDI parent form. If there's no mouse movement for a set number of minutes, the Visible property of all open forms is set to False and the Log On form is displayed. I could do...
21
by: MLH | last post by:
Am having trouble with the following snippet. It stops after only cycling thru open forms. There are many more than that. How to modify this to cycle thru all forms? Sub AllOpenForms() Dim...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.