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.

Dynamic Text Box size

Avatar

Former Community Member
I would like to have a multi-line text box that starts as one line, then grows if the user adds multiple lines of text.



Currently I have the "allow multiple lines" field property checked, and the expand to fit height property checked. However, when I enter text in the preview I get a vertical scroll slider on the right as multiple lines are entered rather than an explanding text box. This verticle scroll slider certainly wouldn't be effective in a printed document.



-thanks
33 Replies

Avatar

Former Community Member
Its the same old problem... MaxChars doesnt take into account if the User does Carriage Control... The only way I think I can solve this is by taking the Scroll Bar off the Field... Does anyone know how to do that?



Kent

Avatar

Former Community Member
I think the closest to what you want to achieve are:



1)Being able to scale down the fontsize to fit the amount of text in the field as the user tabs out of that field.



2)Alert user when the text are overflowed as the user tabs out of the field.



3)Unless you can write a javascript function that can detect keystroke and count number of characters while the user is typing, then what you want is possible.

Avatar

Former Community Member
Jimmy Thanks... Am I missing something here... The Adobe, Javascript Manual says that doNotScroll is available... Does anyone know how to make it work?



Kent

Avatar

Former Community Member
"doNotScroll" should still work with Acro forms. For xfa forms,exposure of the Acro JS interface is limited in version 7. The assumption was the XFA model should support everything that the Acro JS interface provided. Sometimes the XFA model supports it but it's not in Designer yet. Hopefully, it will be in the enhancement list for the future release.

Avatar

Former Community Member
Jimmy... Am I missing a step here... On my Text Field, I have it defined with Multiple Lines and Rich Text Format... So the user can do Carriage Control and more...



If I want to take the Scroll Bar off of that field, where would I put the doNotScroll... In the Javascript, right?



On Initilize (Javascript)... I put...

var f = this.getField("Description");

f.doNotScroll = true;



Is this correct?



Kent

Avatar

Former Community Member
Kent- I'm not an expert but your code sample appears a bit "off" to me. You appear to be declaring a new variable "f", setting it to the value of the field "description" and then setting the variable's doNotScroll property. Why would you set that property for a variable, which isn't seen by the user? Wouldn't you want to be setting that property for the field on the form?



Since it has been years since I took a Java class (and not used it since) and knowing that JavaScript isn't the same, I could be way off base. Perhaps this type of JS reference makes "f" actually refer to the form field. Anyway, after 32 years of programming experience, it just doesn't look right to me - but new languages do things different.

Avatar

Former Community Member
I was having the same problem and found that by setting the parent subform(s) height property to "auto fit" fixed the issue. The scroll bar appears during editing but after the user exits the text field, the field grows vertically and the scroll bar disappears. Hope this helps.

Avatar

Former Community Member
As jimmy mentioned before the doNotScroll property was disabled - in fact any field property which you try to set. In 7.0.5 this restriction was lifted so you can now remove the scroll bar on text fields by using



event.target.getField("form1[0].#subform[0].TextField1[0]").doNotScroll = true;



in the initialise script of the field

Avatar

Former Community Member
Hi,

I know this is an old topic thread but I'm really struggling with this issue. I have a two page form that has four dynamic text boxes, however, I can't get the dynamic boxes to work properly. Either the text flows over each other making it unreadable or it goes off the bounds of the page. What I want to happen is for everything in the forms to keep moving down as the text fields take up room even if it ends up spanning 3 or 4 pages. Is this possible?



Any help that anyone could give me would be much appreciated

Avatar

Former Community Member
Jeffery Ward,



After you have checked off Auto-fit under Y: in Layout menu, make sure you wrap the text boxes in individual subforms and set the content to "Flowed" in the Flow Direcion of "Top to Bottom" (in the Object menu).



The key to a spanning pdf is Flowed subforms.

Avatar

Former Community Member
Hey,

So I have the forms set to auto-fit and I have each of the column that I want to expand set to "flowed" with the direction set to "Top to Bottom". What ends up happening when I enter text either the text writes over each other and makes a mess OR the lines go onto the screen instead of another page. I've tried wrapping the entire document in a sub-document and making it "flowed" and I've tried making just the sections that I want to expand "flowed" and same thing. I know that Adobe can do it I just don't know what' I'm doing wrong.



Thanks for the help,



Jeffrey

Avatar

Former Community Member
Hi Jeffrey,



I have uploaded a fairly simple sample pdf that allows each textbox to be pushed down as more text are being entered. Study the hierarchy, mimic it from scratch, and let me know if you have any more questions.



http://www.megaupload.com/?d=VLMABG7I



P.S. A fairly simple requirement to make this work is to save it in Adobe 7 + dynamic format.



Good luck,

An

Avatar

Former Community Member
Hi all, First of all thanks to everyone for the help!! It was much appreciated and I think I'm just about done! My only other problem is that my basic form spans 2 pages. I have the forms dynamic and they can span 2 pages (thanks An). My problem is that when the forms span into the next page my second page jumps down a page even if the form only takes about two line of the second page. As this is a horrible waste of space and I'm worried that people will miss the second page if it isn't initially visible is there anyway I can keep the text together on the second page? I've already tried checking the "keep with previous box" I've tried selecting in place "following previous". Is there any way to fix this 'cause I think I'm about an inch from pretending it's Friday and giving up!