• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 125
  • 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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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