Skip to main content
tacnola
Known Participant
August 28, 2020
Question

Radio Button color change JavaScript - To change based on selection

  • August 28, 2020
  • 1 reply
  • 2388 views

I have a Radio Button Group with 2 choices(Group1) - a Yes and a No radio buttons. I would like for the color to change based on the which one is selected. When the No button is check, it should be Green and Yes should be white. When the Yes button is selected, it should be Red and the No should be white.

 

I have this currently entered  in the mouse up

event.target.fillColor = event.target.value=="Off" ? color.white : color.red;

But it changes both of the buttons. ot the color choice of the button that is chosen.

 

Any help would be appreciated. Thank you!

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 28, 2020

I recently answered a similar question about check-boxes, but the same applies for radio-buttons.

See: https://community.adobe.com/t5/acrobat/different-fill-colors-for-same-name-check-boxes/m-p/11383110

tacnola
tacnolaAuthor
Known Participant
August 28, 2020

Thank you so much! I did actually search, but I couldn't find the "same" button thing.