Skip to main content
marshalle8980452
Participant
December 10, 2017
Answered

can I change font size of checkbox caption based on button click?

  • December 10, 2017
  • 1 reply
  • 534 views

I have put this code in the click event -

if (cb2-3RetainTaxRef == 1 ){

    cb2-3RetainTaxRef.caption.font.size = "12pt";

else

    cb2-3RetainTaxRef.caption.font.size = "7pt"

}

im trying to get the caption to changed base of the click being set to 1 or 0

This topic has been closed for replies.
Correct answer Thom Parker

This is a LiveCycle form question and should be asked in that forum.

But the answer is Yes, it's just a matter of getting the correct parameter.

Since you are using JavaScript, you'll need to check the checkbox value with: cb2-3RetainTaxRef.rawValue

However, I don't think any of your code will work because there is punctuation in your field name. This is an extremely bad practice. Remove all instances of it.

Also to see how your script is failing, check the console window. It should display at least one error related to your code.

Here's a video tutorial on using the Console. It's a little old, but still valid.

The Acrobat JavaScript Console Window - YouTube

1 reply

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
December 10, 2017

This is a LiveCycle form question and should be asked in that forum.

But the answer is Yes, it's just a matter of getting the correct parameter.

Since you are using JavaScript, you'll need to check the checkbox value with: cb2-3RetainTaxRef.rawValue

However, I don't think any of your code will work because there is punctuation in your field name. This is an extremely bad practice. Remove all instances of it.

Also to see how your script is failing, check the console window. It should display at least one error related to your code.

Here's a video tutorial on using the Console. It's a little old, but still valid.

The Acrobat JavaScript Console Window - YouTube

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often