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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

RENAME THE CAPTION OR CHANGE THE CAPTION FONT COLOR

Avatar

Level 4

Hi ,

My requirement is to change the caption's font color .

e.g

ABC is caption name of one check box

while clicking this check box i want to disply 'ABC' .

or how to change the caption name "ABC" to "DEF" using the script.(RUN Time ).

Thanks.

dhiyan

1 Accepted Solution

Avatar

Correct answer by
Level 10

Toggle the colour of the caption.

// form1.page1.subform1.captionColourChange::click - (JavaScript, client)

if (this.rawValue == true) {

  xfa.resolveNode("ABC.caption.font.fill.color").value = "255,0,0";

}

else {

  xfa.resolveNode("ABC.caption.font.fill.color").value = "0,0,0";

}

Toggle the caption text.

// form1.page1.subform1.captionTextChange::click - (JavaScript, client)

if (this.rawValue == true) {

  xfa.resolveNode("ABC.caption.value.#text").value = "DEF";

}

else {

  xfa.resolveNode("ABC.caption.value.#text").value = "ABC";

}

Steve

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

Toggle the colour of the caption.

// form1.page1.subform1.captionColourChange::click - (JavaScript, client)

if (this.rawValue == true) {

  xfa.resolveNode("ABC.caption.font.fill.color").value = "255,0,0";

}

else {

  xfa.resolveNode("ABC.caption.font.fill.color").value = "0,0,0";

}

Toggle the caption text.

// form1.page1.subform1.captionTextChange::click - (JavaScript, client)

if (this.rawValue == true) {

  xfa.resolveNode("ABC.caption.value.#text").value = "DEF";

}

else {

  xfa.resolveNode("ABC.caption.value.#text").value = "ABC";

}

Steve

Avatar

Level 1

This is exactly what I'm trying to do, but I can't get it working...

I want it so that when I check a checkbox, the caption of *that checkbox* changes color.

I'm trying this code, but it just changes the color of the actual check in the box, not the caption...

form1.#subform[0].Table1[0].Row1[0].#subform[0].CheckBox1::change - (JavaScript, client)

if (this.rawValue != 0) {

     this.caption.font.fill.color.value = "255,0,0";

}

What am I doing wrong?

Mike

Avatar

Level 10

Works fine for me .....my form is dynamic ...is yours?

Paul