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

Submit a textfield only

Eikou
Registered: Feb 5 2009
Posts: 30
Answered

I need a simple script to submit 1 textfield only instead of e-mailing the whole pdf.

I just want a textfield named example: Comments
the text to be submitted to a e-mail address.

how to do this?

My Product Information:
Acrobat Pro 9.0, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
try this:

this.submit({cURL:"mailto:me [at] my [dot] com", aFields:["Comments"],cSubmitAs:"XML"});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

Eikou
Registered: Feb 5 2009
Posts: 30
tnx for the code.
only he submits the whole formfields from the pdf as xml.

so only 1 field that i want be submitted is not working...

mayb the afields:["Comments"] need to be phrased differently?

i just want the comments text field to be submitted.

hmm how to change the script to make it really work?
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Thom made a typo, it should be:

this.submitForm({cURL:"mailto:<span class="spamspan"><span class="u">me</span> [at] <span class="d">my [dot] com</span></span>", aFields:["Comments"], cSubmitAs:"XFDF"});
You can also use the FDF format, but not XML. See that Acrobat JavaScript reference for more information.

George
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The "submitForm()" function submits formatted data. But if all you want is to email a single value then you could send a simple email.
  var cBody = "Data: " + this.getField("Comments").value;app.mailMsg({cTo:"<span class="spamspan"><span class="u">me</span> [at] <span class="d">my [dot] com</span></span>", cSubject:"Comment Data", cMsg: cBody});

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

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Thanks George, Been typing just a little fast;)

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

Eikou
Registered: Feb 5 2009
Posts: 30
thank you it works as intended!