Javascript and setup sheets.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got a problem I've been trying to work through concerning setup sheets and javascript.
On the summary page, I'd like to change the foreground, and background color of a table cell based on the contents of the cell. In this case, it's the toolpath description. I want the background red, and the font white. If the description is empty(which isn't really EMPTY in the HTML file, it contains , but i digress....), I'd like it to be white background with black font. But it seems passing variables from javascript to HTML isn't really all that easy, maybe I am missing something.
Here's a snippit of the code I am using.
<script>
var MyDescription = "${Description}";
var MyBGColor = "#ffffff";
var MyFGColor = "#000000";
if (MyDescription == " ") {
MyBGColor = "#ffffff";
MyFGColor = "color:#000000";
}else {
MyBGColor = "#fc0303";
MyFGColor = "color:#ffffff";
}
</script>
<tr>
<th colspan="1" rowspan="8">NOTES:</th>
<td id="TPNotes" style="{$MyFGColor.value}" bgcolor={MyBGColor.value} colspan="5" rowspan="8">{Description}</td>