Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Set the number of lines allowed in multi-line text field

Avatar

Former Community Member
Hi,



I am designing a form where I have some multi-line text fields where I only want the user to be able to enter a maximum of say 5 lines. I know I could do this by enabling the "Limit Length to Visible Area" option, however, this option is ignored by Reader 7 and the field scrolls, hiding any text that spills beyond the visible area from printouts. It works great in 8 though. To avoid this bug/feature in Reader 7, is there some script that I can use to limit the number of lines allowed in a text field?



Thanks
4 Replies

Avatar

Level 5
I ran into similar issues switching between Acrobat/Reader. Here is the prominent code that works for me when I use this in "Enter" event of the textField.



var aSOM=this.somExpression.substr(15,this.somExpression.length - 1);

var acroField = event.target.getField(aSOM);

acroField.doNotScroll = true;



I chose Allow Multiple Lines alone and noting else.



Good Luck,

SekharN

Avatar

Former Community Member
Thanks for the quick response SekharN. Could you dumb this script down for me a bit. I assume aSOM is my text field. Is this correct? Also, what are the references "somExpression" and "acroField?"



Thanks again.

Avatar

Level 5
This JavaScript code works on any text field and do not need customization.



I am not good with definitions how ever check for more info on somExpression in LC help. In brief this is the independent way of capturing reference syntax expression for this node.



You forgot to post results.

Avatar

Former Community Member
I have ended up using the following code:



event.target.getField("form1.Questions_1to4.Q4.ContactName").doNotScroll = true;



Again, this works in Reader 8, but not in 7. My text fields are still scrolling in version 7 of Reader. Can anyone tell me what is required to make this work in Version 7 of Reader?



Thank you.