Dynamic Text Box size | Community
Skip to main content
February 28, 2005

Dynamic Text Box size

  • February 28, 2005
  • 33 replies
  • 26963 views
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
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

33 replies

June 7, 2005
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
June 7, 2005
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.
June 7, 2005
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
June 7, 2005
"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.
June 7, 2005
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
June 8, 2005
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.
November 16, 2005
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.
November 18, 2005
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
March 20, 2009
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
March 20, 2009
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.