How to Remove Special Characters in ColdFusion
- 1). Locate the ColdFusion CFM or CFML file, right-click on it, click on "Open With," then click on "Notepad." This will open the ColdFusion file in Windows Notepad.
- 2). Copy and paste the following syntax and place it between the <cfscript></cfscript> tags:
<cfqueryparam cfsqltype="cf_sql_varchar" value="#REReplace(myVar,"[^0-9A-Za-z ]","","all") />
This will ensure that all special characters --- all characters that are not alphanumeric --- are removed from a specified input text field, for example. - 3). Click on "File" menu, then click on "Save." This will save the ColdFusion document.
- 4). Exit Notepad.
Source...