Digital Point Forums
Western Union

Go Back   Digital Point Forums > Design & Development > Programming > JavaScript
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old May 2nd 2005, 4:15 pm
thewackonerd thewackonerd is offline
Peon
 
Join Date: May 2005
Posts: 1
thewackonerd is on a distinguished road
switch case statment to set a CSS class style variable

Hi All
I am trying to allow, via the admin section, the ability to change the background colours of a table.
The problems I am having is as follows;
- I have 4 of these sections on a dynamic template page
- not all the sections are used each time the template is called
- I want to either make the colours default to a specific colour if used or if not used, then to display a set colour

I see 2 ways for this to happen;
1 - if statements for the colours
- or -
2 - SQL statement to disallow the table to be shown unless content is posted in the database

I am new to SQL and 'if' statements.
I am using dreamweaver MX 2004 with access 2000.

This is the code I want to be able to hide, I have 4 of these section on a page.

I believe that a switch case statment to set a CSS class style variable is the way to go but I am a bit thick and dont pick these things up quickly, your help would be invaluable.

------------------------------------------------------------------------------------------------
Code:
<table width="150" border="0" cellpadding="1" cellspacing="0" bgcolor="#<%=(rs_pages.Fields.Item("S_SideHeading4_ColourBG").Value)%>">
            <tr>
              <td>
            <table width="150"  border="0" cellspacing="0" cellpadding="4">
                  <tr>
                    <td align="center" bgcolor="#<%=(rs_pages.Fields.Item("S_SideHeading4_ColourBG").Value)%>"><strong><%=(rs_pages.Fields.Item("S_SideHeading4").Value)%></strong></td>
                  </tr>
                  <tr>
                    <td bgcolor="#<%=(rs_pages.Fields.Item("S_SideContent4_ColourBG").Value)%>">
            <%Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
			objFile = Request.ServerVariables("SCRIPT_NAME")
			ImagePath = Server.MapPath("../site_images\")
			ImagePath = ImagePath & "\" & (rs_pages.Fields.Item("S_SideImage4").Value)
			If objFileSystem.FileExists(ImagePath) then%>
            <img src="../site_images/<%=(rs_pages.Fields.Item("S_SideImage4").Value)%>"  border="0" align="right" /><%=(rs_pages.Fields.Item("S_SideHeading4").Value)%> 
            <%End If%>
            
            <%= CI_Preserve((rs_pages.Fields.Item("S_SideContent4").Value)) %>
                    </td>
                  </tr>
              </table>
      </td>
    </tr>
</table>
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java's abstract class concept lewisb Programming 13 Nov 3rd 2009 3:19 am
How to insert a column values in existing db (msaccess 2000) table? gilgalbiblewheel ASP 2 Apr 8th 2005 8:59 am
little help with switch case staement fraser5002 JavaScript 12 Mar 27th 2005 4:15 pm


All times are GMT -8. The time now is 12:30 am.