Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

For Each Item in Request.Form

Posted on 2003-03-05
2
Medium Priority
?
3,622 Views
Last Modified: 2006-11-17
Hi,

I am looping through the request.form collection to collect the data the user has entered.  This data is then validated.

However, if there is a select (listbox) element, which hasn't been changed from the default "please select" (no value), it does not appear in the collection.  Part of the validation is to make sure all these select elements have been selected.

Is this behaviour by design?  Any idea's how I can get around this.

Thanks

'Loop through form elements and save data into session
     For Each Item in Request.Form
       ItemValue = Request.Form(Item)
       Session(Item) = ItemValue

................
0
Comment
Question by:topcat_uk
2 Comments
 
LVL 3

Accepted Solution

by:
HMax earned 150 total points
ID: 8071494
This behaviour is by design and the way to get around it is to specify a default value other than an empty string.


_____
HMax
0
 
LVL 1

Author Comment

by:topcat_uk
ID: 8071566
Hi HMax,

Funny, I just found that in some testing I was doing.

But, you got here first, so you get the points.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question