[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

remove case sensitivity from condition

Posted on 2010-09-08
10
Medium Priority
?
429 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
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!

 

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 1000 total points
ID: 33628344
oh its javascript try this then

mystring.toLowerCase()
0
 
LVL 2

Assisted Solution

by:Comtek
Comtek earned 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…

649 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