Copy link to clipboard
Copied
Hello,
I'm building a simple form that has a few text boxes. I need the boxes to have a max text font size of 6. However, I need that size to shrink if the user inputs more text than the box size. I don't have room for wrapping or multiple lines. I found an answer on this form via google that told me to do the following
Properties...
Options
Actions
add this code:
event.target.textSize = 0;
add this code:
var len = event.target.value.toString().length; //console.println("LEN " + len); if (len < 4) { event.target.textSize = 18; } else { event.target.textSize = 0; }
However, when I attempt to use this code (but with text size set to 6) it will work the first time text is entered. However, If I erase some text and try to put anything else in, the text will go bigger than 6 point. It goes back to "auto" text size. The JavaScript only seems to work one time. I'm pretty new to using JavaScripts. What am I doing wrong? Any help is appreciated.
I'm using Adobe Acrobat Pro DC
Copy link to clipboard
Copied
Hi
Set the field height to 0.32 or 0.33 centimetres, so the auto-sized text begins with a size of (about) 6 pt.
😉
Copy link to clipboard
Copied
Hi
Set the field height to 0.32 or 0.33 centimetres, so the auto-sized text begins with a size of (about) 6 pt.
😉
Copy link to clipboard
Copied
Well, that was an easy fix. Thank you!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more