Expand my Community achievements bar.

How to calculate the size of a Text Field?

Avatar

Former Community Member
Is there a way to calculate the number of characters allow in a Text Field? If a uer type over this number of characters a popup window will appear telling the user that he/she has too much texts. Of course I could use the Limit Length, but I have to manually put texts into this text field and count them. If the Limit Lenth number is too small, the texts does not fill the whole text field. If the number is too big then the texts does not get printed.
2 Replies

Avatar

Former Community Member
There would be no easy way to do this. You'd need to do some pretty fancy calculations, it would all depend on the size of the field, what font is used, the font size, whether it's been bolded, underlined, italicized, etc etc.



What are you trying to accomplish? Make it so that the user can type in the text field until it fills and then have it stop without scroll bars coming up to allow him to keep typing?



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Thanks for the response. That is exactly what I'm trying to accomplish.