Asp question

by "Web Alchemy Concepts" <sales(at)webalchemy.on.ca>

 Date:  Fri, 2 May 2003 20:58:06 -0400
 To:  <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Hello,

I am trying to validate some data from a form using VBSCRIPT ASP 2.0. I
have all the fields checked for entered for data ok and the form inserts
into the database fine but I also need to check one form field against 8
possible entries. 

So essentially if the form is filled in and the field in question has
data it needs to go through this routine of final verification for the 8
possible entries. If what they entered doesn't equal one of these
possible entries then go to my error page. Right now you can enter any
old crap into the pwd field and it happy inserts the form contents to
the database.

Here is what I have so far:

<% ' convert federation to uppercase and check against known codes
If Request("CONTENT_LENGTH") <> 0 AND pwd <> "" Then

If (UCase(Request.Form("pwd"))) = "ch1" then
ec="ch1"
End If

If (UCase(Request.Form("pwd"))) = "ch2" then
ec="ch2"
End If

If (UCase(Request.Form("pwd"))) = "ch3" then
ec="ch3"
End If

If (UCase(Request.Form("pwd"))) = "ch4" then
ec="ch4"
End If

If (UCase(Request.Form("pwd"))) = "ch5" then
ec="ch5"
End If

If (UCase(Request.Form("pwd"))) = "ch6" then
ec="ch6"
End If

If (UCase(Request.Form("pwd"))) = "ch7" then
ec="ch7"
End If

If (UCase(Request.Form("pwd"))) = "ch8" then
ec="ch8"
End If

Else

Response.Redirect("error.asp?error=You+did+not+enter+a+recognized+federa
tion.")

End If
%>

Execute code for insert to database...
=====================

What am I missing here?

TIA

Jeff

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA