Solved

Test a string with Quote Marks in it

Posted on 2010-08-13
4
381 Views
Last Modified: 2013-12-24
How do you test a string that has quote mark in it. See code?
<cfif form.My_Text contains "<embed" and form.My_Text does not contains "<param name="wmode" value="transparent">">

Open in new window

0
Comment
Question by:RickEpnet
  • 2
4 Comments
 
LVL 1

Expert Comment

by:coldfusionwebdev
Comment Utility
Try this:

<cfif form.My_Text contains "<embed" and form.My_Text does not contains '<param name="wmode" value="transparent">'>
0
 
LVL 14

Author Comment

by:RickEpnet
Comment Utility
I had already tried that.

I get this error.
       Invalid CFML construct found on line 96 at column 93. ColdFusion was looking at the following text:' The CFML compiler was processing: A cfif tag beginning on line 96, column 10. A cfif tag beginning on line 96, column 10. The error occurred on line -1.
   
0
 
LVL 1

Accepted Solution

by:
coldfusionwebdev earned 500 total points
Comment Utility
Sorry, take out contains and replace that with contain like this:
<cfif form.My_Text contains "<embed" and form.My_Text does not contain '<param name="wmode" value="transparent">'>
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
Note also you can escape quotes by using two.

i.e., ""

The use of single quotes on the outside should be easier though as you don't have to change the original string.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Use System DSN 6 70
CFFILE upload help 98 109
Comparing 2 Lists Coldfusion 8 41
Passing value to a stored procedure 8 67
PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now