Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a variable for bgcolor in TD tag

Status
Not open for further replies.

knightjb1

Programmer
Feb 12, 2008
27
0
0
US
Hello,
I am trying to pull a user selected color from a database and use it in my td tag to change the background color of the cell. This is used on a calendar. I want the user to be able to color code events. The string being stored currently is in the format of #6699FF and I can pull it from the database just fine outside of the td tag. When i try to use it in the td tag such as:

<cfoutput><td bgcolor="#colorpick#">blah blah</td></cfoutput>

I have also tried <td bgcolor="##colorpick#> AND
<td bgcolor ='#"#colorpick#"'>

I know this is probably simple but if someone could help me it would be a big help. Thanks
 
I figured it out. I was wrong on what the issue was. It was telling me my variable was undefined but that is because is did not set it to "" if there was no result so that fixed my problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top