Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

change caption font color for radio button when item is selected

Avatar

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
eugzl
Level 2

31-07-2018

Hi All.

I have group of RadioButtons and I would like when one of RadioButton from group is selected than font color of caption for that button will change color. If that is possible. How to do it?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

01-08-2018

Hi,

Try some code like this JavaScript in the click event of the RadioButtonList

switch (this.rawValue) {
     case "1":
          this.resolveNode("#field[0]").font.fill.color.value = "255,0,0";
          this.resolveNode("#field[1]").font.fill.nodes.remove(this.resolveNode("#field[1]").font.fill.color);
          this.resolveNode("#field[2]").font.fill.nodes.remove(this.resolveNode("#field[2]").font.fill.color);
          break;
     case "2":
          this.resolveNode("#field[0]").font.fill.nodes.remove(this.resolveNode("#field[0]").font.fill.color);
          this.resolveNode("#field[1]").font.fill.color.value = "0,255,0";
          this.resolveNode("#field[2]").font.fill.nodes.remove(this.resolveNode("#field[2]").font.fill.color);
          break;
     case "3":
          this.resolveNode("#field[0]").font.fill.nodes.remove(this.resolveNode("#field[0]").font.fill.color);
          this.resolveNode("#field[1]").font.fill.nodes.remove(this.resolveNode("#field[1]").font.fill.color)
          this.resolveNode("#field[2]").font.fill.color.value = "0,0,255";
          break;
}

Depending on the number of buttons you have you might want to restructure the code.

This code means only one radio button will be colored at a time, is that what you were after?

Answers (0)