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

color changing buttons

hphewitt
Registered: Aug 12 2009
Posts: 5

Hello,

I am trying to make radio buttons that, when they are filled in, their background color changes. I've managed to get them to change color, but I've so far been unable to get them to revert to their default color when they aren't filled in (for example, when you clear the fields on the form). I'm pretty much
javascript illiterate though.

I used this to change the color (on mouse up)

var name = this.getField("");
name.fillColor = color.green;

Is there a way to make them revert to their original color when they aren't filled in?

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You can use a script to cycle through each radio button by field name and set the fill color to your default color.

I would not use the 'null' string as a filed name, it is easy enough to obtain an event target's name by use of the 'event.target.name' or the 'event.targetName' property.

George Kaiser