Conditional Page Background Color

G

Guest

First, this isn't *really* a FrontPage question--but I am using Frontpage as
my HTML editor so here goes...

The following code is from the HTML Status Bar--a 'customizable' portion of
the display at the cash register when using the Point of Sale module of
Microsoft's Retail Management Sytem:

<body onload="doStartup()" scroll="no" STYLE="position:absolute; top:0px;
left:0px; width:100%; height:100%; padding:10px; font:bold 13pt verdana;
color:white;
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,
StartColorStr='#8eb6d9', EndColorStr='#000000')">

What I want to do is make the background & font colors conditional on a
customers credit limit.

Basically, I want to do this:
<if> CreditLimit < 0
<then>
<body onload [see above, except font color = black, gradient starts and ends
with FF0000]>
</then>
<else [default background code above]>
</else>
</if>

But HTML doesn't have an if statement...

Ideas?

Tom
 
T

Trevor L.

Terrible said:
First, this isn't *really* a FrontPage question--but I am using
Frontpage as my HTML editor so here goes...

The following code is from the HTML Status Bar--a 'customizable'
portion of the display at the cash register when using the Point of
Sale module of Microsoft's Retail Management Sytem:

<body onload="doStartup()" scroll="no" STYLE="position:absolute;
top:0px; left:0px; width:100%; height:100%; padding:10px; font:bold
13pt verdana; color:white;
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,
StartColorStr='#8eb6d9', EndColorStr='#000000')">

What I want to do is make the background & font colors conditional on
a customers credit limit.

Basically, I want to do this:
<if> CreditLimit < 0
<then>
<body onload [see above, except font color = black, gradient starts
and ends with FF0000]>
</then>
<else [default background code above]>
</else>
</if>

But HTML doesn't have an if statement...

Ideas?

Tom

It may not be an FP question as such, but it is web related.

You would need some Javascript to change the colour.

How would you pass the Credit Limit to the JS?
Is it known when this page is opened?
Perhaps the page is called from another page, where Credit Limit is known,
or is it stored on a database?
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
 
M

Mike Mueller

That's the basic train of thought I was one. If the info is
being pulled from a db, then it most likely using a server
side script- which could also be used to change the colors
based on the credit
Another option would be to use a cookie, and use either js
or server scripting to read the cookie and set a color


: Terrible Tom wrote:
: > First, this isn't *really* a FrontPage question--but I
am using
: > Frontpage as my HTML editor so here goes...
: >
: > The following code is from the HTML Status Bar--a
'customizable'
: > portion of the display at the cash register when using
the Point of
: > Sale module of Microsoft's Retail Management Sytem:
: >
: > <body onload="doStartup()" scroll="no"
STYLE="position:absolute;
: > top:0px; left:0px; width:100%; height:100%;
padding:10px; font:bold
: > 13pt verdana; color:white;
: >
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,
: > StartColorStr='#8eb6d9', EndColorStr='#000000')">
: >
: > What I want to do is make the background & font colors
conditional on
: > a customers credit limit.
: >
: > Basically, I want to do this:
: > <if> CreditLimit < 0
: > <then>
: > <body onload [see above, except font color = black,
gradient starts
: > and ends with FF0000]>
: > </then>
: > <else [default background code above]>
: > </else>
: > </if>
: >
: > But HTML doesn't have an if statement...
: >
: > Ideas?
: >
: > Tom
: > --
: > Stop fishing for e-mail
:
: It may not be an FP question as such, but it is web
related.
:
: You would need some Javascript to change the colour.
:
: How would you pass the Credit Limit to the JS?
: Is it known when this page is opened?
: Perhaps the page is called from another page, where Credit
Limit is known,
: or is it stored on a database?
: --
: Cheers,
: Trevor L.
: [ Microsoft MVP - FrontPage ]
: MVPS Website: http://trevorl.mvps.org/
: ----------------------------------------
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top