Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Passing CSS Styles in a drop-down box

Explorer ,
Oct 05, 2006 Oct 05, 2006
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
TOPICS
Server side applications
250
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 05, 2006 Oct 05, 2006
LATEST
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


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines