this isn't for points, just and fyi... you don't need #'s when assigning a value to a variable in the case above...
<cfset form[i] = #rereplaceNoCase(form[i], "['""## !@$%^&*()+={}|\/?<>,]", "" , "all")#>
should be...
<cfset form[i] = reReplaceNoCase(form[i], "['""## !@$%^&*()+={}|\/?<>,]", "" , "all") >
they both work, it's just better style and coding to not use extra #'s when they're not required...
Main Topics
Browse All Topics





by: bwasyliukPosted on 2007-01-22 at 14:53:13ID: 18370431
It looks as if you might be trying to do a RegEx replace, and with a couple minor code modifications the following will do just that:
<cfif not StructIsEmpty(form)>
<cfloop collection="#form#" item="i">
<cfif i neq "fieldnames">
<cfset form[i] = #rereplaceNoCase(form[i], "['""## !@$%^&*()+={}|\/?<>,]", "" , "all")#>
<cfoutput>
#i# = #form[i]#<br>
</cfoutput>
</cfif>
</cfloop>
<cfelse>
Form Struct Empty <br><br>
</cfif>
Let me know if I am off-base,
Thanks,
Ben
www.ScheduleForce.net