Expand my Community achievements bar.

Text Field Settings--Immediate Expansion, Simultaneous Expansion

Avatar

Level 1

Hi all, I am working on a form in LiveCycle Designer (version 9, testing my work with Reader 10.1) and have a few issues I would like help with.  First of all, I will say that I have successfully set my text fields to expand vertically to accommodate text, and form elements are flowed so they move down correctly, etc.  I don't need help with that.  My questions are:

1)  The form contains many expand-to-fit text fields that start out only 1 line tall.  How do I set a text field so it will expand immediately when the user runs out of room while typing (rather than simply displaying scrollbars while the user is typing and then, only when the user shifts focus out of the field, expanding)?

2)  I have two text fields, side by side.  Is there any way to set them so that they will always expand vertically to the same size (i.e., whichever one has less text will grow to match the vertical size of the one that has more text)?

Please let me know if these are at all possible within LiveCycle's provided options or if they would require scripting and if so, how much.  Thank you!

5 Replies

Avatar

Level 10

Hi,

If you have a look at this example, you will see on the last page a small script in the enter event (and exit event) setting the h and minH properties: http://assure.ly/g80MVY.

Again on the second issue, you could set the minH of each object based on the other's actual height. However on balance I find tables better for this sort of behaviour, as it is built in without having to script.

Hope that helps,

Niall

Avatar

Level 1

Thank you, your answer for the second issue was very helpful!   I converted the text fields to a table and now they always expand the same amount. 

Your answer to the first issue has helped me achieve the desired effect (by setting the field's minimum height to 2.5 inches on entry and back to 0.348 inches on exit); unfortunately, I've found a bug.  If the user enters lots of text (e.g. a page and a half's worth) in a text field and then clicks at the bottom of the text field:

EndOfPageBug1edited.gif

then the insertion point jumps to a completely different place in the document, in this example, right on top of some fixed text:

EndOfPageBug2edited.gif

Text typed into the field does end up in the correct place (once the user clicks out of the text field, the typed text will show up in the field like it should), but this is a pretty noticeable visual bug that could really confuse users.  Any ideas why this happens?

EDIT:  Is there any property that corresponds to the actual, visible height of a text field that has auto-expanded to fit text (as opposed to the minimum height (minH), which does not change as the field expands, or the height (h) which I believe would be null for auto-expand)?  Or does "h" actually update to be equal to the current height of the field?

Message was edited by: sol_720 at 11:45 AM July 18, 2012

Avatar

Level 1

UPDATE:  Niall O\'Donovan, I took another look at the last page of the example pdf at the site you linked me to, and the exact same issue occurs in it!! If I type more than 1 page worth of text in the multiline expanding text field that changes its minH to 2.5 inches when clicked, then if I click anywhere in the second or later page of text in that field, the insertion point goes to the corresponding location in the first page of that text field instead!  Is there any workaround to fix this bug, or is this an error Adobe will have to fix?

Avatar

Level 10

Okay,

I see what you mean. I am not sure that there will be a work around for this unwanted behaviour. If you believe that people will normally input a lot of data, then the best approach may be to give a reasonable height to the object to start with and omit the script. If the form is UI becomes unwieldy when spaning over two pages, then the user may become confused.

Niall

Avatar

Level 10

Hi,

I wasn't able to reproduce your problem but your screenshot reminds me of a solution to fix a layout issue in a flowing layout.

Maybe this can help you.

http://blogs.adobe.com/dmcmahon/2011/10/10/lc-forms-es-text-overlapping-on-page-break-using-nested-s...