Expand my Community achievements bar.

Change textfield background color based on checkbox status.

Avatar

Former Community Member
Can someone point me to the right place or describe for me how to cause the background of a text field to change color based on the status of a check box? Also, is it possible to cause the background to flash, say alternating colors to draw attention to the fact that this field needs filling?



Thanks so much.



Stan
7 Replies

Avatar

Former Community Member
Group,



I found solution from one of the sample pdfs posted here. The sample works, but when I transfer the code to my document, it does not. Can someone tell me what is wrong with this code?



if (CheckBox1.rawValue == false)

TextField1.presence = "hidden";

else

TextField1.presence = "visible";



I want the field to stay hidden until the user checks the checkbox at which time the text field is made visible. I haved added this code in the click section of the checkbox as a js. I have even tried to duplicate on a blank form with only a single box and a single text field. No luck. What am I missing?



Thanks!



Stan

Avatar

Level 1

Hi everyone,

Apologies for hte stupid newbie question, but here goes.

I am doing my first form in Adobe Acrobat. Designing in LifeCycle. At some point when i first started I was given an option as to what colour the Text field would be, and I chose red (options were blue, green, and I think white or beige). Half way through my form, this looks terrible and I want to change, but don't know how. Can not seem to find an option to change this. Can someone point me in the right direction?


Thanks

Bernie

Avatar

Former Community Member

Field Background change options are under "Border" pallet. You can make this visible just by using Shift+F8 and then look for "Background Fill".

Avatar

Level 1

Thanks for that, but I am referring to something different.

There is no colour when in the design phase, and the Background fill says "none". It is when I convert it (or preview) to a PDF, that the areas you can type in are a light red colour. I am trying to make this white or neutral, even after converting.

Hoping you can help.

Thanks

Avatar

Former Community Member

check if you have turned on Highlight fields or Required Fields at the application level. If you still can not figure out I like to take look at your form, email me your copy at n_varma(AT)lycos.com

Avatar

Former Community Member

Hi,

Try this code on initialize of check box at runtime

if (checkbox1.rawValue = 1){

textfield1.border.fill.color.value = "255,0,0";

}

Thanks

Shan

Avatar

Level 1

I have a form with [checkbox 1] and [text field 1]

[text field 2] [text field 3] [text field 4] [text field 5].

I would like for text fields 2-5 to change to green when someone checks [check box1] or hovers over [text field 1].

I'm having trouble with the script on this. Can you help?

Thanks!