Skip to main content
tacnola
Known Participant
August 28, 2020
質問

Radio Button color change JavaScript - To change based on selection

  • August 28, 2020
  • 返信数 10.
  • 2400 ビュー

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!

 

このトピックへの返信は締め切られました。

返信数 10

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
tacnola作成者
Known Participant
August 28, 2020

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