Solved

How can I strip out special characters and HTML tags, I know this question has been asked a 1000 times on Google but having trouble with those solutions.

Posted on 2016-08-01
3
46 Views
Last Modified: 2016-08-03
I have a input field where I'm using tinymce and say my value is "My product <sup>2</sup>" ... I'm using...

REReplaceNoCase(str, "[^0-9a-zA-Z ]", "", "ALL") but when it submits the value to the db I get ... "My product&lt;sup&gt; 2&lt;/sup&gt;". Expected results would be "My product 2".

I know you are probably saying, well why use a rich text editor. I'm wanting to save the stripped out version to another column in the db and the html version to another column.

Thanks!
0
Comment
Question by:brihol44
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
dgrafx earned 500 total points
ID: 41739304
remove tags
<cfset tempX=ReReplace(arguments.x, "(,)|(<[^>]*>)", " ", "All")>
0
 

Author Closing Comment

by:brihol44
ID: 41741725
Thanks!
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 41741729
Glad it worked for you!
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

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
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…

760 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