@stuart: "Hi,
I want to be able to check if a form element exists in the form post data.
IN this instance I want to find out if Request.Form("Postcode") is part of
the forms collection.
I have tried:
If Request.Form("Address Line 5").Length > 0 Then Response.Write("It
exists!")
but get the error:
Object reference not set to an instance of an object.
Thanks in advance,
Stu
-
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (<url>
Version: 6.0.510 / Virus Database: 307 - Release Date: 14/08/2003"
    @zlatkinam: "The problem here is, that it doesn't exist - but you are trying to get the
Length property of an object that doesn't exist
Try: If Request.Form("Address Line 5") <> "" Then
OR
If Not IsNothing(Request.Form("Address Line 5") ) Then
news:<email_address>
<quote>"
    @kevin: "Your problem could be in naming form fields with spaces in the names.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
<url>
Neither a follower nor a lender be.
news:<email_address>
<quote>"
    @stuart: "Many thanks.
The 'If Not IsNothing(Request.Form("Address Line 5") ) Then' worked great.
Kevin > I had tried both with and without the spaces in the form name and
the spaces don't alter the functionality. I know spaces in form names is not
good practice, but the form is built by an end user using a WYSIWYG edtor
and could be called anything...I'm almost surprised that they stopped at
spaces :-)
news:<email_address>
<quote>
data.
of"
    @kevin: "Make sure it works in all browsers, unless you're developing specifically
for IE. Chances are, it won't.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
<url>
Neither a follower nor a lender be.
news:eR%<email_address>
<quote>
not
part"
{'source': 'USENET', 'other_information': '{"reply_count": 4, "forum_name": "microsoft.public.dotnet.framework.aspnet.20140624.mbox"}', 'file': 'data/output/usenet-microsoft.public.parquet'}