Solved

Test a string with Quote Marks in it

Posted on 2010-08-13
4
382 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

21 Experts available now in Live!

Get 1:1 Help Now