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
61 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 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

19 Experts available now in Live!

Get 1:1 Help Now