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

Submit form button

tsierra
Registered: Jul 24 2009
Posts: 43

I created a customized "submit form" button (see script below)

var cResponse = app.alert ("Do you wish to email this order to our Customer Service Department?\n\nChoose YES to proceed or choose NO cancel.",2,2);

if (cResponse ==4) {
var nResponse = app.alert("Don't forget to save a copy of this document for your records.",3,0);
if (nResponse ==1); {
this.mailForm({
bUI: false,
cTo: "tsierra [at] sterlingpublishing [dot] com",
cSubject: "SP10 New Titles Order Submission",
});
}}

The button works perfectly when I use Adobe Acrobat on my Mac, but doesn't work on a PC.
The email application browser pops up on the Mac (which is what I want) but doesn't on the PC.
IS there any reason this is happening? I need this document to be cross platform.

My Product Information:
Acrobat Pro 8.1.7, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You have to set "bUI" to true. There is no way this will work unless you do. The Mac version happens to be smart enough to ignore this option and always display the UI. The PC version is probably throwing an exception. Did you look in the Console Window to see if an error was reported?

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

tsierra
Registered: Jul 24 2009
Posts: 43
Thanks for your response!

Sorry, I should have worded my previous message better.
I am not a javascript programmer. The javascript in my previous message was created for me.
This is very new to me.

So what you're saying is that the bUI should set to true so that this button will work on PC and Macs alike?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
According to the documentation the mailForm() function should fail on both the Mac and PC if it is run from a script in a PDF and the bUI input is set to false. The MAC version just happens to be more forgiving.

So yes, set the bUI input to true, like this:
 this.mailForm({bUI: true,cTo: "<span class="spamspan"><span class="u">tsierra</span> [at] <span class="d">sterlingpublishing [dot] com</span></span>",cSubject: "SP10 New Titles Order Submission",});

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