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

More help with submitform()

mattp
Registered: Nov 5 2008
Posts: 8

I hate to ask for help again but ...well..I need it.

I've worked through some errors to get to this point where I have the following code and adobe accepts it.

However, when I hit the button nothing happens. (it just flashes)
I've made sure the settings set to mouse down and run a javascript.

var compnm = this.getfield("ManuCompName");
var ingname = this.getfield("IngredientName");
var kconname = this.getfield("pdevname");
var to = this.getfield("KContactEmail");
var start = "NEW RMIS from: "
var subj = start.value + compnm.value + "'s ingredient " + ingname.value + " for " + kconame.value ;

event.target.submitForm({cURL:to+"?&body=Sender%20or%20supplier%20Please%20remember%20to%20attach%20all%20supporting%20documentation.&subject="+subj+"",cSubmitAs:"PDF",cCharset:"utf-8"});

Thanks anyone for the help

My Product Information:
Acrobat Standard 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You're mixing JavaScript here. Do you have a LiveCyle form or an AcroForm? If you have an AcroForm then replace "event.target" with "this"

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/]http://www.adobe.com/devnet/acrobat/[/url]

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

mattp
Registered: Nov 5 2008
Posts: 8
Thom,

I have Acrobat 9.0 Stanard.
I've acutally tried both this.submitform() and event.target.submit()
neither are working.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You definately need to use "this.submitForm()". The other thing you need to look at is the formatting of URL. Since it's an email URL is must start with "mainto:". I make this mistake all the time. All of the spaces and special characters also need to be removed. It's a good idea to build the URL string separately, in a variable, without any of the "%20" replacements and then use the Core JavaScript "encodeURI()" fucntion to fix it up.

If there is still a problem, then use "console.println()" statements to write the URL and any other relavent info to the console window. This will give you a better idea of what's going on.

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/]http://www.adobe.com/devnet/acrobat/[/url]

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