Skip to main content
Inspiring
October 5, 2006
Question

Passing CSS Styles in a drop-down box

  • October 5, 2006
  • 1 reply
  • 276 views
Hi Guys,

Yes im back again with another problem. I would imagine that some of you out there use Helm to host your websites ? Well you may have noticed the in-built billing system. You will have seen that when you have a positive amount the colour is green and when your balance is red, the text turns to red. Also the drop-down boxes in the billing system and in various other places have green, orange, red for different statuses such as inactive, banned and so on.

I am building a billing system for a website at the mo and i thought it would be a very good idea if i could do something very similar only i am unsure how to pass the colour values into my database. Can i just input the HTML ?

I would really appreciate some guidance on this as its starting to bug me and i've been trying to figure this out for ages!

Thanks a bunch,
Adam
This topic has been closed for replies.

1 reply

Inspiring
October 5, 2006
Create the styles for your statuses in your site css

e.g.
.redstyle{
background-color: red;
}
.greenstyle{
background-color: green;
}

Then in the loop which displays the records from the DB check the status of
the DB column and apply the style accordingly

e.g.
If rs.Field.Item("ammount").Value > 0 Then
Response.Write("class=greenstyle")
Else
Response.Write("class=redstyle")
End If

Regards
Bren

Why do I climb mountains? Simple! because they are there
www.3peakschallenge.co.uk