coffeyb Posted August 10, 2001 Posted August 10, 2001 Is there any way to change the color of text in a field depending on the data in it? For example, I have a field ACTIVE which only contains either YES or NO. Is it possible to change the text color of YES in all the records that that contain YES in green?
Keith M. Davie Posted August 10, 2001 Posted August 10, 2001 Try an [FMP-If:] conditional on your format file.
Jeff Spall Posted August 10, 2001 Posted August 10, 2001 Hi, yes it's quite easy when you've done it!! Here's one that changes the colour of the table cell. the database has a calculation field 'colourfield', which is: ---------------------- Case(status="on server","66ccff", status="accepted","00cc66", status="resend","ff3300", status="new version","66ccff","ffffff") ---------------------- so the cell turns blue, red, green, white depending on the status of the job in the html: ---------------------- <TD WIDTH=50 BGCOLOR="#[fmp-field:colourfield]"> ---------------------- In this database, the text is greyed out when the job is still with the production department, so I use an "IF" in the page: ---------------------- <FONT SIZE="-1" FACE="verdana,arial,geneva,sans-serif" [FMP-IF:status.cn.production] COLOR="#999999" [/FMP-IF]> <B>[FMP-FIELD: status]</B></FONT> ---------------------- I guess you could use an 'else' as well here These are really easy to do and look cool to your boss/customer regards, Jeff
AndreasBoehmer Posted August 13, 2001 Posted August 13, 2001 Or you could make it really simple with a stylesheet in HTML. Let's say you set two styles like this: .yes = {font-color:#00cc66} .no = {font-color:#00000} Then you could write in your HTMl: <p class="[FMP-field:Active]">This is text and it changes colour according to the active-field. </p> Of course this only works in browsers that support stylesheets (which is meanwhile all the current ones).
Recommended Posts
This topic is 8840 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now