Expand my Community achievements bar.

Auto font size for textfield by javascript

Avatar

Level 2

Hi there.  I got the following script for a textfield in a fillabe PDF.  Th length of the textfield is 150.  It is required that if the text is > 100, the text size will be set to point 8, otherwise it will be point 12.

var tf = this.rawValue;

if (tf.length>50) {

tf.textSize=8;

}

The above script was added to the script editor show=Change (not ok), full (failed), validate & validationState (no response).  Did I miss something?

Thanks.

1 Reply

Avatar

Level 2

Can anyone please advise?

Cheers