Is it possible to dynamically set the colors for fields on a form? I have some computed fields that users want to be in certain colors depending on their values. I know it’s not possible straight from Designer, so I’m thinking I might have to use JavaScript but I have no idea where to begin.
Could someone confirm whether this is possible, and offer some suggestions for making it work?
Thanks,
Charles
Subject: setting field colors on a form
You can create a field called $PaperColor with a value from 0 to 15 (which represent the 16 basic colors you see at the top of the color picker in Notes). See the post below for a bit more detail.
http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/7d76f263380014ff80256cbd005fa61f?OpenDocument
Subject: setting field colors on a form
Well, you could also associate each value with a graphical icon and add a small layout region with hide-when to display the icon.But yeah, I agree that this kind of design, multiplied by 270 fields makes it really cumbersome.
As an application analyst however, I would strongly advise my suer AGAINST that kind of requirement. You want a little bit of color strategically placed to highlight an important status or a digital signature, not a chrismas tree each time you open a document - otherwise it looses all its impact and value.
My 2 cents 
Nicolas Abesdris
Quintessence e-solutions Inc.
Subject: setting field colors on a form
A form is shared by many users and many documents. So the form must be capable of all colours. Make a set of fields and use hide-when formulas to hide all except one. Or use a Rich Text field and store the colour in the document with the value. Both of these solutions are “straight from Designer”.
Subject: RE: setting field colors on a form
Thanks Rod, the problem is I have over 270 fields, so the hide-when approach is going to be incredibly ugly to implement. If users decide to change the colors it’s going to be extremely cumbersome to maintain, too.
I’ve not worked much with RichText, so I’m not sure how to go about storing the color with the content. And again, since there are 270 fields, I’m not sure I want to weigh down a
form with that many RichText fields.
Overall I think the CSS approach is going to work best for me, so I’ll pursue that path.
Thanks,
Charles
Subject: setting field colors on a form
Is this application web based or client based? I am not sure what can be done in the client, but on the web you can use CSS by having multiple classes for the fields and then swap out the style id using javascript based on your dynamic details. In the client I suppose you could use multiple fields and hide whens but this could be ugly… I dont have much experience with the client… maybe someone else can give you better advice for this environment.
Subject: RE: setting field colors on a form
It is Notes client based, but I can render passthru HTML in the Notes client. I have limited experience with JavaScript and CSS, but I think I see where this is headed. Do you have an example handy of swapping class ID’s based on a JavaScript function? If not I’ll just search the web.
Thanks,
Charles