?
Solved

For Each Item in Request.Form

Posted on 2003-03-05
2
Medium Priority
?
3,616 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

801 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