Change fill color of radio buttons

New Here ,
Apr 12, 2018

Copy link to clipboard

Copied

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;

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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"]);

TOPICS
Acrobat SDK and JavaScript, Windows

Views

125

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Change fill color of radio buttons

New Here ,
Apr 12, 2018

Copy link to clipboard

Copied

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;

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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"]);

TOPICS
Acrobat SDK and JavaScript, Windows

Views

126

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 12, 2018 0
Most Valuable Participant ,
Apr 12, 2018

Copy link to clipboard

Copied

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"]);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 12, 2018 0
robp0716 LATEST
New Here ,
Apr 12, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 12, 2018 0