Expand my Community achievements bar.

SOLVED

RENAME THE CAPTION OR CHANGE THE CAPTION FONT COLOR

Avatar

Former Community Member

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
Former Community Member

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
Former Community Member

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

Former Community Member

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

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----