Solved

remove case sensitivity from condition

Posted on 2010-09-08
10
425 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
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
chrome and edge version of getElementById("p").attributes("title").value 2 36
innerHTML 7 34
Html form and modal / img src -problem 3 30
multiple selects 23 48
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

860 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