Expand my Community achievements bar.

SOLVED

Changing the caption of dropdown field

Avatar

Former Community Member

Hi All,

I am trying to change the caption of some drop down field based on some condition. The following condition is written on some other dropdown feild:

 

if (this.rawValue == "Ad Hoc Payments")

{    

     xfa.resolveNode("form.PaymentDetails.ddlInvoiceFrequency.caption.#text").rawValue = "TEST CAPTION";

}

But, it seems to be not working.

Any help would be highly appreciated.

Thanks,

Vijay.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Try with this:

delete the caption in the object field palette and type this in the change event:

if( xfa.event.newText == "Ad Hoc Payments") this.caption.value.text.value = "TEST CAPTION";

View solution in original post

5 Replies

Avatar

Correct answer by
Level 2

Try with this:

delete the caption in the object field palette and type this in the change event:

if( xfa.event.newText == "Ad Hoc Payments") this.caption.value.text.value = "TEST CAPTION";

Avatar

Level 5

Or try this:

if (YourFieldName.rawValue == "Ad Hoc Payments")

{

    xfa.resolveNode("YourTargetFieldName.caption.value.#text").value = "Alternate Caption:";

}else

{

    xfa.resolveNode("YourTargetFieldName.caption.value.#text").value = "Caption:";

}

Helpful?

Kind regards Mandy

Avatar

Former Community Member

Thanks Zampazampa,

Your solution helped.

Thanks once again.

Avatar

Former Community Member

Thanks nele_sonntag,

Your solution helped.

Thanks once again.

Avatar

Level 5

Hi Vijay,

great. I'm glad that I could help you

I think it's god for the other user if you select "correct answer". Then the other users know that your problem is solved.

Kind regards Mandy