Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

remove case sensitivity from condition

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
GessWurker
Asked:
GessWurker
  • 4
  • 3
  • 3
2 Solutions
 
rockiroadsCommented:
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
 
rockiroadsCommented:
egf

dim sTN


sTN = Request.QueryString("TN")

sTN = lcase(sTN)

0
 
ComtekCommented:
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
Technology Partners: 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!

 
GessWurkerAuthor Commented:
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
 
rockiroadsCommented:
oh its javascript try this then

mystring.toLowerCase()
0
 
ComtekCommented:
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
 
GessWurkerAuthor Commented:
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
 
ComtekCommented:
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
 
rockiroadsCommented:
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
 
GessWurkerAuthor Commented:
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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now