Skip to main content
Participant
April 12, 2018
Answered

Change fill color of radio buttons

  • April 12, 2018
  • 1 reply
  • 669 views

I know this is very basic js but I am attempting to change the color of 3 groups of radio buttons based on the mouse up action on another specific radio button in a different group.  After the color change is set i am then resetting the group and setting it to read only but the trouble I am having is setting the fill color.  I am sure my syntax is incorrect but I have googled and can not find one that will work.  I am attempting to set the fill color to gray.  Any assistance would be appreciated. Thank you.

this.getField("Group2").event.target.fillColor = "150,150,150";

this.resetForm(["Group2"]);

this.resetForm(["Group3"]);

this.resetForm(["Group4"]);

this.getField("Group2").readonly = true;

this.getField("Group3").readonly = true;

this.getField("Group4").readonly = true;

This topic has been closed for replies.
Correct answer try67

The first line is incorrect. Change it to:

this.getField("Group2").fillColor = ["RGB", 150/255,150/255,150/255];

Also, you can merge lines 2-4, like this:

this.resetForm(["Group2","Group3","Group4"]);

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 12, 2018

The first line is incorrect. Change it to:

this.getField("Group2").fillColor = ["RGB", 150/255,150/255,150/255];

Also, you can merge lines 2-4, like this:

this.resetForm(["Group2","Group3","Group4"]);

robp0716Author
Participant
April 12, 2018

This worked perfectly.  Thanks for taking the time to help me out!