?
Solved

can't do bgcolor within cfset tag

Posted on 2006-05-20
4
Medium Priority
?
245 Views
Last Modified: 2013-12-24
Hi,

 I have this code (I have deleted some lines I think are uninvolved), and my problem is that if I enter a bgcolor on the td cells, I get an error on the webpage.:
<cfset custmailmsg2_html="
<html>
<body>
<title></TITLE>
<LINK rel=STYLESHEET HREF='../stylesheet.css' TYPE='text/css'>
<TABLE WIDTH='600' BORDER='0' CELLSPACING='0' CELLPADDING='0' ALIGN='CENTER'>

      <TR><td width="80" height="20" align="left" bgcolor="Blue"><img src='#request.webroot#/images/headlines/receipt/space.gif' width='80' height='20'></td>
      <td height="20" colspan="2" bgcolor="Blue"><IMG SRC='#request.webroot#/images/headlines/receipt/bill_to.gif' WIDTH='160' HEIGHT='20'></td>
      <td height="20" colspan="2" bgcolor="Blue"><IMG SRC='#request.webroot#/images/headlines/receipt/ship_to.gif' WIDTH='160' HEIGHT='20'></td>
      </TR>

The error I see is:
attributes.fuseaction: final_receipt message: Invalid CFML construct found on line 293 at column 24.
detail: ColdFusion was looking at the following text:
80

The CFML compiler was processing:

a cfset tag beginning on line 275, column 2.
 Any ideas? Seems like the cfset tag doesn't ilke the bgcolor parameter. Thanks!
0
Comment
Question by:mel150
  • 2
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
pinaldave earned 1500 total points
ID: 16728333
Do this instead of what you are doing...
<cfsavecontent variable="custmailmsg2_html">
<html>
<body>
<title></TITLE>
<LINK rel=STYLESHEET HREF='../stylesheet.css' TYPE='text/css'>
<TABLE WIDTH='600' BORDER='0' CELLSPACING='0' CELLPADDING='0' ALIGN='CENTER'>

     <TR><td width="80" height="20" align="left" bgcolor="Blue"><img src='#request.webroot#/images/headlines/receipt/space.gif' width='80' height='20'></td>
     <td height="20" colspan="2" bgcolor="Blue"><IMG SRC='#request.webroot#/images/headlines/receipt/bill_to.gif' WIDTH='160' HEIGHT='20'></td>
     <td height="20" colspan="2" bgcolor="Blue"><IMG SRC='#request.webroot#/images/headlines/receipt/ship_to.gif' WIDTH='160' HEIGHT='20'></td>
     </TR>

your complete text
</cfsavecontent>

now you can use your variable just like you are using #custmailmsg2_html#
0
 

Author Comment

by:mel150
ID: 16735259
hmmm. I tried that, and the email came through, but in that table, it's not pulling from the database, it just gives the variables:

Name:   #get_order.billing_firstname# #get_order.billing_lastname#   #get_order.shipping_firstname# #get_order.shipping_lastname#
Company:   #get_order.billing_company#   #get_order.shipping_company#
etc.

I should have told you more about what I was trying to do. Beyond the images I listed, I have this code:

<TD CLASS='paragraphtext' WIDTH='150' BACKGROUND='#request.webroot#/images/headlines/receipt/light.gif'><span class='paragraphtext'>#get_order.billing_firstname# #get_order.billing_lastname#</td>
            <TD WIDTH='10' BACKGROUND='#request.webroot#/images/headlines/receipt/light.gif'>&nbsp;</TD><TD WIDTH='150' BACKGROUND='#request.webroot#/images/headlines/receipt/light.gif'><span class='paragraphtext'>#get_order.shipping_firstname# #get_order.shipping_lastname#</td>
      </tr>

And so on.

 Do you have any idea why the cfset tag doesn't like that bgcolor? Thanks!
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 16735746
Use cfoutput around that variable.
<cfoutput>#custmailmsg2_html#</cfoutput>
0
 

Author Comment

by:mel150
ID: 16736001
Hi- sorry, I'm  pretty new at coldfusion. I'm not sure where that cfoutput tag should go. I'm sure your answer is correct,  so I will award you the points with my thanks. What I actually di, though, was this:

 <TR><td width="80" height="20" align="left" BACKGROUND='#request.webroot#/images/backgrounds/purple.gif'>img src='#request.webroot#/images/headlines/receipt/space.gif' width='80' height='20'></td>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question