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

large List box split into two smaller ones

suewhitehead
Registered: Jun 3 2008
Posts: 232
Answered

I have a form that cannot easily hold a long list box field. It could easily hold two shorter list box fields. I there any way that I can split the list box field into two and have it still work as if it were only one list box? Or even put columns into the list?

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
What exacty do you mean by "still work as if it were only one list box?". It would be difficult to make them scroll together. And each will have it's own value. But you could set them up so that selections in either affect other changes on the form as if they were one list box. For example, use the selection change event in both to set the value of a hidden text box to the selection value. Then use this value for other options on the form.

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

suewhitehead
Registered: Jun 3 2008
Posts: 232
Ok so if I create another list box, please help me figure out how I use both list box fields for the address variable in this script. I know it is probably elementary, but I just don't see it.

var myDoc = event.target;
var address = List1.rawValue
var sub = "Return Authorization form";
var msgBody = "Attached is the Return Authorization form.";

myDoc.mailDoc({
bUI: false,
cTo: address,
cSubject: sub,
cMsg: msgBody,
cSubmitAs: "PDF"
});
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Is the "To" address for the email the only place the list box is used?

To start off, add a "ToAddress" field to the form.

In the "Change" event for each of the fields add this code
ToAddress.rawValue = xfa.event.change;TheOtherList.rawValue = null;

Of course you need to change "TheOtherList" to the name of the other list field

Then, in your submit code get the address value from the "ToAddress" field.

If you are putting the email address in the export value of the list item you'll need to do this a bit differently. Don't have the details off hand, but it's just a matter of using the display value to get the export value.

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