| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|classic asp case select not case sensitive|
aps case select
| 9:58 pm on Feb 12, 2012 (gmt 0)|
On one of our forms we use following:
myfilter = Request.Form("x_name")
myfilter = left(myfilter,5)
select case myfilter
this works just fine, if word "pharm" is found it redirects user to TESTERROR.asp
But this is case sensitive and for example word "Pharm" will not get caught and it will pass through the form. How would we re-write this to work and not be case sensitive.
| 11:08 pm on Feb 12, 2012 (gmt 0)|
Always has been case-sensitive - almost all tests are with the exception of the extended text comparison.
Use LCase(string) to lower case it (UCase for upper case).
It's a real pain, I agree - adds a lot more extra code on longer scripts and makes for strange debug errors. It would have been useful if there had been (eg) an AlwaysMakeCaseLower switch.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved