Solved

remove case sensitivity from condition

Posted on 2010-09-08
10
426 Views
Last Modified: 2012-05-10
How to I remove case sensitivity from the condition below?

if (Request.QueryString("TN") == "ConflictRequest" && (Request.QueryString("EI7") == "No Conflict, awaiting retention" | Request.QueryString("EI7") == "No Conflict, work accepted"))
...

I need the condition to work no matter the case of the querystring contents.
0
Comment
Question by:GessWurker
[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
  • 4
  • 3
  • 3
10 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 33628144
Could you not use variables in this, so assign Request.QueryString(...) to a variable then convert that to upper or lower case then check against that
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33628154
egf

dim sTN


sTN = Request.QueryString("TN")

sTN = lcase(sTN)

0
 
LVL 2

Expert Comment

by:Comtek
ID: 33628165
You can make everything lower case:

if (Request.QueryString["TN"].ToLower() == "conflictrequest" && (Request.QueryString["EI7"].ToLower() == "no conflict, awaiting retention" | Request.QueryString["EI7"].ToLower() == "no conflict, work accepted"))
0
Independent Software Vendors: 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!

 

Author Comment

by:GessWurker
ID: 33628298
nope. so far nothing works. all suggestions result in 500 internal server error. Note: We're not working with pure classic asp. See code start up to conditions below...

<%@ Language='JavaScript' %>
<%
//  ASP support page

//==================================================
// set location of Web App
//
   var   sInmWebAppDllURL, sInmWebAppExeURL;
   var   sServerName, sExecDirectory, sExecDLL;
   var   sProtocol = '';
   var      sAuthUser, sAuthPassword, sAuthType;
   var      bBasicAuthentication;
   var  tbRec;
   var newHTML;
   
   if (Request.QueryString("TN") == "Engagements" && Request.QueryString("EF0") == "ConflictRequestID")
   {
     
       tbRec = " Engagements record ";
     newHTML = '<input type=button style="font-family: arial, Helvetica,sans-serif; font-size:12pt; font-style:normal; color:red" value= "Click here to finish new' + tbRec + '" name=finish onclick=location.replace("/dbtw-wpd/exec/dbtwpub.dll?TN=Engagements&QY=find%20(ConflictRequestID%20%3D%20' + Request.QueryString("EI0") + '&RF=EprocessAutoRefresh&EF=EprocessEditForm&AC=QBE_QUERY&XC=%2Fdbtw-wpd%2Fexec%2Fdbtwpub.dll")>';
      
   }
 
   else if (Request.QueryString("TN") == "Engagements" && Request.QueryString("EF0") == "EngagePreparerEmail")
   {
     
       tbRec = " Engagements record ";
     newHTML = '<input type=button style="font-family: arial, Helvetica,sans-serif; font-size:12pt; font-style:normal;" value= "OK" name=OK onclick=location.replace("../../Ask-A-Librarian-FAQs/ConflictCheck/ConflictCheckCirculation.htm")>';
      
   }
 
   else if (Request.QueryString("TN") == "ConflictRequest" && (Request.QueryString("EI7") == "No Conflict, awaiting retention" | Request.QueryString("EI7") == "No Conflict, work accepted"))
   {
...
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 250 total points
ID: 33628344
oh its javascript try this then

mystring.toLowerCase()
0
 
LVL 2

Assisted Solution

by:Comtek
Comtek earned 250 total points
ID: 33628371
Ahh, so it's JavaScript then. Instead of .ToLower() try .toLowerCase():

if (Request.QueryString("TN").toLowerCase() == "engagements" && Request.QueryString("EF0").toLowerCase() == "conflictrequestiud")

You could also declare those variables earlier:
var TN = Request.QueryString("TN").toLowerCase();
var EF0 = Request.QueryString("EF0").toLowerCase();

then use:
if (TN == "engagements" && EF0 == "conflictrequestiud")

The last suggestion would probably be the cleanest way to do it.
0
 

Author Comment

by:GessWurker
ID: 33628418
Yeah... I've had all the same ideas as you folks. So far, no luck. Anytime I try to convert case, I end up with an error. Will keep trying.
0
 
LVL 2

Expert Comment

by:Comtek
ID: 33628437
You get an error on this:

var TN = Request.QueryString("TN").toLowerCase();
var EF0 = Request.QueryString("EF0").toLowerCase();
?
If so, what is the error?
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33628545
Just a thought, can you use Request object in javascript? I thought asp code couldn't mix with JS.
Try this js alternative http://snipplr.com/view/799/get-url-variables/ (and read the comments as their are alternatives)
0
 

Author Comment

by:GessWurker
ID: 33629800
All: Thanks for your help. I'll split up points. But here's what worked:

   var EI7 = String(Request.QueryString("EI7")).toUpperCase()
etc. etc.

just as good, of course:

 var EI7 = String(Request.QueryString("EI7")).toLowerCase()
etc. etc.

Without "String", total failure.

YIKES!

Anyway... thanks for your participation!
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 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