Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Conditional Formatting in Dreamweaver Table

Posted on 2010-08-23
10
Medium Priority
?
726 Views
Last Modified: 2013-12-13
I am using Dreamweaver to create a "Dynamic" information table.  It is setup as a repeat region and pulls data from a MySQL database.  One of the cells of data contains the values "Hot" or “Medium" or “Cool"  The user decides when they enter the data.  This is held in a dropdown menu.  I would like to highlight the row that has "Hot" red. My table of data is as follows

First Name    Last Name    Etc    Etc   Hot
So this row needs to be highlighted red.

I can do this in Access but how can I do it in Dreamweaver or CSS or something else?
Thanks
0
Comment
Question by:napsternova
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 3

Expert Comment

by:wmcdon7160
ID: 33501338
Do you want it to highlight red when it pulls an existing row from the database, when you user selects it as a new entry, or both?
0
 

Author Comment

by:napsternova
ID: 33501419
Hmmm, both would be impressive but ultimately the row in the "report" table.  I have a couple CSS scripts already attatched.
0
 
LVL 3

Expert Comment

by:wmcdon7160
ID: 33501456
Can you post the code that repeats the result row?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:napsternova
ID: 33502515
<?php do { ?>
              <tr class="<?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?>">
                <td><input type="checkbox" name="kt_pk_Leads" class="id_checkbox" value="<?php echo $row_Recordset1['LeadID']; ?>" />
                  <input type="hidden" name="LeadID" class="id_field" value="<?php echo $row_Recordset1['LeadID']; ?>" /></td>
                <td><div class="KT_col_LeadFirstName"><?php echo KT_FormatForList($row_Recordset1['LeadFirstName'], 20); ?></div></td>
                <td><div class="KT_col_LeadLastName"><?php echo KT_FormatForList($row_Recordset1['LeadLastName'], 20); ?></div></td>
                <td><div class="KT_col_ContactLevel"><?php echo KT_FormatForList($row_Recordset1['ContactLevel'], 20); ?></div></td>
              </tr>
              <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
0
 

Author Comment

by:napsternova
ID: 33504588
Should I post something else?  
0
 
LVL 3

Expert Comment

by:wmcdon7160
ID: 33504626
Sorry, had that nagging "day job" to tend to... :)

what does <?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?> look like in your CSS?
0
 

Author Comment

by:napsternova
ID: 33505433
Pretty sure that represents alernating row colors, white for the odd and gray for the even.  The hightlight (rollover) color is green.  Day job?  Yeah they tend to get in the way.  :)
0
 
LVL 3

Expert Comment

by:wmcdon7160
ID: 33507978
How familiar with PHP are you? It would appear from the code that you are probably just using the drag/drop functionality of Dreamweaver.

I ask, because I would suggest putting some PHP conditionality into the TR that points to conditional CSS, and didn't know how detailed to be...
0
 

Author Comment

by:napsternova
ID: 33510945
wmcdon7160,
PHP I can handle but CSS not so much.  I have been using the original version of the Adobe toolbox because it works really well.  It does seem to add a lot of extra code but it generates forms and tables that are really clean looking.  I use the Conditional functionality in MS Access all the time but never on the web.  This would be a great tool I can use for many things, like checking dates and sending reminders, highlighting fields when a certain date comes around, highlight table rows to bring attention, etc.  I would like to understand how to do this.  If I should read up on CSS I can do that too, and sounds like I probably should.
Thanks,
Jeff
0
 
LVL 3

Accepted Solution

by:
wmcdon7160 earned 1000 total points
ID: 33511613
Make a new CSS class called "hot", or whatever.
It will look a lot like the KT_EVEN class.

Then add an IF statement (or DO WHILE) in the <tr> code.
I would try something like the following:
[it's separated on different lines for clarity]


<tr class="
<?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?>
<?PHP IF ($row_Recordset1['ContactLevel'] == "hot") 
  {echo " hot";} ?>
">

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

647 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