cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Background Colour of Text-Fields

s0009214902
Participant
0 Kudos

Hello Everybody,

I am new in Adobe Forms and I have a problem in formatting background colour of a text-field in my form.

I have designed in my form a calender.

Every day is a text-field. Now I want to set the background colour to grey if the field is a sunday.

Now my question is this possible only with scripting?

Could you give me some help?

Thanks a lot

Sigi

Accepted Solutions (1)

Accepted Solutions (1)

rakesh_m2
Contributor
0 Kudos

Hi Sieg,

Scripting would be one option, but setting 52 fields using script would be difficult.  Instead you could use this approach.

1.  Group Jan 1st, Jan 8th, Jan 15th, .. +7 days,... in group 1. (As these days will be having same day in all years)

2.  Group Jan 2nd, Jan 9th, Jan 16th.... in group 2.  like wise make 7 groups.

3. In a group, make sure all fields have same names. 

4. Now on a subform, write this script in javascript.

var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
for (var i=0; i <= fields.length-1; i++) {
if (fields.item(i).name == "FIELDNAME") {
fields.item(i).fillColor = '<Fill your color combination>';
}
}

--

Rakesh

Answers (2)

Answers (2)

navip
Active Participant
0 Kudos

Hi Sieg,

Try with the below Option in the Layout--->Palettes--->Font.

Please find the screen shot of  the same.

-Naveen

Former Member
0 Kudos

Hi Sieg,

Honestly I do not understand how your calender works.

Are you generating any year 's calender dynamically using script, and to change background of Sunday to grey?

Inside your loop, check if it is sunday, change the cell 's background to grey.

Some sample script to change the background color.

http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000833.html

Hope this helps.

regards,

Xiang Li