I am populating form variables from a database.
If the field value has a double quote in it, such as 3″ for 3 inches, then the html source looks like the following:
<input name="width" value="3"">
Q: How do I handle fields that contain double quotes?
I first thought it was a cfqueryparam problem, but it turns out it’s an html problem.
Use
HtmlEditFormatwhen displaying the value.Like this:
There is also:
For more complete/heavyweight stuff, you could consider OWASP’s ESAPI – a Java Security API which can be used from CF and provides the following:
(from Pete Freitag’s cfunited presentation slides)