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
82 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

732 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