changing the colour of the field

I have a form inside a tabpanel, and the form is in table field. Now I
i want to write a method to change the colour of all the field in a row when a certain specification is met, but with my code below, the colour of the fields of all the rows got changed too.

var aFoundset = databaseManager.getFoundSet(forms.Activities.controller.getServerName(), forms.Activities.controller.getTableName())
aFoundset.loadAllRecords()
var aSize = aFoundset.getSize()
var aRec, bDate, aDate, sDate
var cDate = new Date()

if(aSize !=0)
{
for(var i=1; i <= aSize; i++)
{
aRec = aFoundset.getRecord(i)
bDate = aRec[‘baseline_date’]
aDate = aRec[‘actual_date’]
sDate = aRec[‘slipped_date’]

if(bDate != null && aDate == null && cDate.getTime() > bDate.getTime())
{

forms.Activities.controller.getSelectedIndex(i)
forms.Activities.elements.baseline_date.fgcolor = ‘#cc0000
forms.Activities.elements.actual_date.fgcolor = ‘#cc0000
forms.Activities.elements.activity_number.bgcolor = ‘#cc0000
forms.Activities.elements.activity_name.fgcolor= ‘#cc0000
}

}

}

I need someone to help correct my mistakes. Thanks

Hi nani,

This happens because the elements that you are setting to a colour exist in every row of the table and so you need to think about affecting the background colour of the row itself

This thread may give you the answer and some supporting code:

If not run a forum search on something like: ‘table row color’ and you’ll get quite a few hits discussing this

Cheers
Harry

thanks a bunch Harry.