ColdFusion - Escape any double-quotation marks in the parameter and wraps the result in double-quotation marks

DE() - escape any double-quotation marks in the parameter and wraps the result in double-quotation marks

DE.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DE function example: how to escape any double-quotation marks in the parameter and wraps the result in double-quotation marks</title>
</head>

<body>
<h2 style="color:Crimson">DE Function Example</h2>

<cfquery name="qBook" datasource="cfbookclub">
 SELECT BookID, Title FROM BOOKS
</cfquery>

<table cellpadding="0" cellspacing="0">
 <tr bgcolor="Green" align="center">
     <td><b>BookID</b></td>
        <td><b>Title</b></td>
    </tr>
    <cfloop query="qBook">
  <cfoutput>
            <tr bgcolor="#IIF(qBook.CurrentRow mod 2 eq 0, DE("Pink"),DE("HotPink"))#">
                <td>#BookID#</td>
                <td>#Title#</td>
            </tr>
        </cfoutput>    
    </cfloop>
</table>
</body>
</html>






More ColdFusion examples