These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

create a form that changes text color depending on answer.

scribbleit
Registered: Jul 21 2010
Posts: 21

I would like to create a form that does this:

The form will be a series of questions. When the user clicks the form field "yes", I would like that question to turn GREEN. When the user clicks "no", I would like that question to turn RED.

Then end result will be that the report shows a series of green and red so that the client can easily see what needs to be addressed.

I am currently on a MAC using InDesign CS3 and I have Acrobat Professional (8). Will an upgrade offer me the solution I need or should I be using a different application?

Ultimately, the files will need to be emailed to the client or printed for those clients that do not have computer access.

Thank you!

My Product Information:
Acrobat Pro 8.0, Macintosh
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi scribbleit,

You can use JavaScript to accomplish this. Here is a tutorial from the Learning Center here on Using Colors in Acrobat JavaScript-
http://www.acrobatusers.com/tutorials/using-colors-acrobat-javascript

There are some script examples in the tutorial on changing text color in a field based on data entered into tthe field.

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
scribbleit
Registered: Jul 21 2010
Posts: 21
Thanks!!!! I will check that out. I've always been afraid of the term Javascript b/c I just don't know about it. Time to learn!
scribbleit
Registered: Jul 21 2010
Posts: 21
okay, javascript makes sense, but i need more info. i cannot figure out how to actually input the javascript. i also need the scripts to make these specific things happen. i could use a radio button or a check box. is there a list of javascript commands somewhere?

thanks again!
scribbleit
Registered: Jul 21 2010
Posts: 21
so, every tutorial i have found tells me how to change the color of a form field. that is not what i need to do.

if the question is: "do you like flowers?" and a person answers "yes", then i want the whole question "do you like flowers?" to turn green. if they answer "no", then i want it to turn red.

how do i make this happen?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Do you mean that you want to change the color of the font?
Then you need to use the field's textColor property (see the tutorial provided by Dimitri).

Edit: Or do you mean that you want to change the color of text which is NOT in a form field? If that's the case, then you're out of luck.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

scribbleit
Registered: Jul 21 2010
Posts: 21
yes, the color of the text that is not the form field. bummer! any other thoughts? maybe i could make each question in a form field that could change color depending on the action of another form field? would that work?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
If the text is in a form field then you could change its color, yes. You can also set it up as read-only so the user can't edit it themselves.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

scribbleit
Registered: Jul 21 2010
Posts: 21
thank you!

so, most of this document will be form fields then. does it still make sense to design it in InDesign? I guess the background colors, logo, etc will still make sense in InDesign, but what would I do for fields that get filled in with comments. some of those fields could be 1 line comments or a whole paragraph, so it may need to be flexible in size.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Acrobat forms are not dynamic. You will need to use LiveCycle for that.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

scribbleit
Registered: Jul 21 2010
Posts: 21
i am on a mac. is live cycle for mac yet?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
No.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

scribbleit
Registered: Jul 21 2010
Posts: 21
Okay, so I have given up on my original post and have a new way to solve the problem. Here goes...

I will put the question into a form field in black. When the form is filled out, there will be a series of yes/no questions. I want the original question to turn green if they choose the Yes box and to turn Red if they choose the No box. This seems like a simple If/Then statement, but I have no idea how to write it in javascript.

There will be several questions & answers, so please, please, please tell me it will work this way and how to do it. ????Thanks!!!!