Solved

Test a string with Quote Marks in it

Posted on 2010-08-13
4
383 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
ID: 33434632
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
ID: 33434681
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
ID: 33434721
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
ID: 33437053
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

775 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