By: Bryce
<!--- Set param for background, bg --->
<cfparam name="bg" default="">
<html>
  <head>
    <title>Color Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    </head>

    <body bgcolor=
<cfoutput>"#bg#"</cfoutput>>

<!--- Output the URLEncoded attribute for background color, see below. --->
<h3>Note: this also demonstrates use of <em>URLEncodedFormat</em> and <em>CFParam</em></h3>
<p><br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("green")#</cfoutput>">green</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##eaebf6")#</cfoutput>">#EAEBF6</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##fff5df")#</cfoutput>">#FFF5DF</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##000099")#</cfoutput>">#000099</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##999999")#</cfoutput>">#999999</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##666699")#</cfoutput>">#666699</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##666666")#</cfoutput>">#666666</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##999966")#</cfoutput>">#999966</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##ffffff")#</cfoutput>">#FFFFFF</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##000000")#</cfoutput>">#000000</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##006699")#</cfoutput>">#006699</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##660099")#</cfoutput>">#660099</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##336699")#</cfoutput>">#336699</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##993366")#</cfoutput>">#993366</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##0066cc")#</cfoutput>">#0066CC</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##ccff00")#</cfoutput>">#CCFF00</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##333366")#</cfoutput>">#333366</a>
<br><a href="../../../inetpub/wwwroot/Test/bgcolor_changer.cfm?bg=<cfoutput>#URLEncodedFormat("##666633")#</cfoutput>">#666633</a>

<p>The sky's the limit, so try your own colors.

</body>
</html>

About This Tutorial
Author: Bryce
Skill Level: Beginner 
 
 
 
Platforms Tested: CFMX
Total Views: 83,746
Submission Date: March 25, 2004
Last Update Date: June 05, 2009
All Tutorials By This Autor: 1
Discuss This Tutorial
Advertisement


Website Designed and Developed by Pablo Varando.