• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 131
  • Last Modified:

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.

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
brihol44
Asked:
brihol44
  • 2
1 Solution
 
dgrafxCommented:
remove tags
<cfset tempX=ReReplace(arguments.x, "(,)|(<[^>]*>)", " ", "All")>
0
 
brihol44Author Commented:
Thanks!
0
 
dgrafxCommented:
Glad it worked for you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now