These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Wrapping Text Field Boxes

Carol85
Registered: Mar 11 2008
Posts: 5
Answered

Can I wrap or chain two form fields together so that the text put in by a user will flow from one text box on to another?

My Product Information:
Acrobat Pro 8.1.2, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes you can, but it requires scripting. Text fields have a "Keystroke" event property named "fieldFull" that becomes true when the text field fills up. The text field has to also have it's options setup in a certain way. You can use the "keystroke" event to detect when the field is full and then call the "field.setFocus()" function to move the keyboard focus into the next field.

You'll need to read about the "event" object in the Acrobat JavaScript Reference and do some testing to get a handle on this.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Tech264
Registered: Apr 4 2008
Posts: 111
I have a form that's designed in LS Designer 8.2 and it looks like a notebook sheet of paper with lines. Normally I would have just designed a long text box and chose Multi-Lines but my boss doesn't like that method. So I did a search here about wrap text and found this thread. Could you provide an example of what it is you mean about keystroke and or setfocus?

If I have 10 lines and I set each field to limit the text entries to the visable area, I can create an event that when it gets to the end of the field it will automatically allow the employee to keep typing without having to hit tab to get to the next line?

Any answer will be greatly appreciated. Thank you.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This answer is for a regular AcroForm. LiveCycle forms are different. In LiveCycle there is a "Full" event that's called for a field that is limited to it's length.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

bmasarik
Registered: May 7 2009
Posts: 4
Hello

I have Adobe Acrobat 9 pro extended. I found this article to be exactly what I need but I am very very noobish when it comes to scripting. I have been trying to look over the scripting reference and find myself at a loss. So I was hoping that you may know of a place that I could look at practical examples, usually I can get enough understanding to modify them for my use.

I greatly appreciate any help you can give

Big thanks in advance

Brian
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Here's an example keystroke script that will perform move the keyboard focus from one field to the next. Assume the second field is named "Text2", and that the first text field is setup in such a way that it produces the correct event triggers when the field is full.
if(!event.willCommit){if(event.fieldFull){var oFld = this.getField("Text2");oFld.value = event.change;oFld.setFocus();}}

The last character entered by the user is not placed in the first field so it has to be copied into the next field. Note that there is no easy way to go back the other way.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

bmasarik
Registered: May 7 2009
Posts: 4
Thank you so much, that was exactly the srcipt I was looking for.

Brian
Eric Fanning
Registered: Mar 2 2011
Posts: 1
I ahve acrobat 9 and I have a form that has 9 nines and I want to be able to type in line 1 and have the text flow to the other 8 lines with out having to hit the tab. Does anyone know how to do this?