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

Forms

Josman
Registered: Jul 15 2009
Posts: 31
Answered

I hope you can help me I am new in this subject, but I created a form in Adobe Acrobat 9 and everything is going well but when I place this form in the web and the user wan to submit the form it goes automatically without showing the e-mail window because he/she has to attach a file with the form. Please I need Help

Josman

My Product Information:
Acrobat Pro 9.1.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Interesting, in my experience Acrobat always displays the email client window. It's standard Acrobat security policy to keep the user involved in all activities that communicate externally. Are you sure you're submitting via email?

If you want to force the issue, then there is a way. But first, I need to know how you are currently submitting data. What Acrobat/PDF feature are you currently using to perform the submit? What data format is being submitted? Is the PDF Reader Enabled, Secured, or Certified?

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

Josman
Registered: Jul 15 2009
Posts: 31
Hi Tom, I redo my form all over again but I still having the
same problem, I will like to send you my form but I donot know how to insert my file into this window.
About your questions
Iam currently submiting by mail, I am using Acrobat 9 Pro, and I Enabled the form for Acrobat reader, no secured, no certified.
Thanks
Josman

Josman

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Please do not send me your form. But I do need more info

How exactly are you setting up the email submit? What is being submitted?

Why does the user need to attach something to the email?

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

Josman
Registered: Jul 15 2009
Posts: 31
OK, I created a button and in action I pull out the submit form, I placed a e-mail adress in the URL box as mailto:theemailadress@where it needs to go.
the form a print request form , the user needs to fill this out whit information about printing, when the user has to submit this the form the email window has to apear so the the user can attach the file has to be printed. In my test the form goes directly to the adress but it does not allow to attach a file so the form can go with the file.
May be this can help you, when I submit the file I have a Autgoing Message Notification
"An emailmessage with "MC Form" pdf attached has been given to your defoul email application. If your email application is configured to send email automatically on a schedule, the email will be sent automatically".
tThis only happen when the user submit from Acrobat Reader, not from Acrobat 9 Pro. In Acrobat Pro the window email pop up and you can attach a file and send with PDF Form.
J
Thanks..

Josman

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
That's exactly what I needed to know. You have two options:

1. Use the JavaScript mailDoc() or mailForm() function. Both of these functions have a parameter for forcing the email UI to be displayed.

EX: this.mailDoc(true, "theemailadress@where", null, null, "Return Data");

2. Ask the user to attach the file for print to the PDF form instead of the email.

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

Josman
Registered: Jul 15 2009
Posts: 31
Hi Tom,
I run Javascript
I create a new button ,options, run Javascript, fill the window with EX: this.mailDoc(true, "theemailadress@where", null, null, "Return Data"); closed, make the form to extended Features in Adobe reader.
and it give me a window that it said Microsoft Office Outlook does not recognize null.
am I doing someting wrong ?
Iam goin for the first option to make it work if it does not work and the nex attenpt I will go for the second option.
Thanks.
Josman

Josman

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
well yes, I didn't test out the code. Here's another way to write the same thing:

this.mailDoc({bUI:true, cTo:"theemailadress@where", cSubject:"Return Data"});

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

Josman
Registered: Jul 15 2009
Posts: 31
It WORKS, thank you but I have other problem, I have three required fields so when I hit submit, it does not recognize the required field in other words does not give the warning to fill the required field
Thank you .
J.

Josman

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Nope, the "mailDoc" function is not a true submit function, so it doesn't check required fields. You'll need to add your own checks to the code or use the "doc.submitForm()" function. Here's a link to a couple of articles that explain these functions.

http://www.acrobatusers.com/tutorials/2006/submitting_data
http://www.acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address

You can find even more material by searching in the tutorials.

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

Josman
Registered: Jul 15 2009
Posts: 31
How do I add this check to the code?
what you saing is to do this?
this is my required fields
var RequiredFields = new Array(4);
RequiredFields[0] = “Copyright Notice ”;
RequiredFields[1] = “Requester”;
RequiredFields[2] = “Number of originals”;
RequiredFields[3] = “Number of copies”;

var AlertMsg = new Array(4);
AlertMsg[0] = “Please check Copyright Notice box.”;
AlertMsg[1] = “Please provide Requester’s name.”;
AlertMsg[2] = “Please provide Number of originals.”;
AlertMsg[3] = “Please provide Number of copies.”;
after this I do not know what is next
Thanks.
J.

Josman

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I would suggest trying out the "doc.submitForm" function first.

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

Josman
Registered: Jul 15 2009
Posts: 31
Hi Tom I need some more help here
I picked the "doc.mailForm()" function because I need this for to be send as a PDF not as XML
this is so far I did.

var cToAddr = “theemailadress@where”;

var this.getField(“CopyrightNotice”).value;
var this.getField(“RequesterName”).value;
var this.getField(“NumberofOriginals”).value;
var this.getField(“NumberofCopies”).value;

??? How I do set up this part
???
???

this.mailDoc({bUI:true, cTo:"theemailadress@where", cSubject:"Return Data"});

Thanks.
J.
I will apreciate your help.

Josman

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
the "doc.submitForm()" function will email data in any PDF data format, as well as sending the entire PDF.

But if you want to do your own pre-submit validation then all you need to do is test the data values for an empty string. This is all the submit does.

Here's an example:

var cErrMsg = "";
var cTst = this.getField(“CopyrightNotice”).value;
if(cTst == "")
cMsg = "Please check Copyright Notice box";

if(cTst.length)
app.alert(...)
else
... do submit ...



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

Josman
Registered: Jul 15 2009
Posts: 31
Here one more time.
I was readig ther topics and I foud this script actions so I put on my form and it works half way
this is wat I wrote

function validate_required(field,alert)
{
var fld = this.getField(field);
if( (fld == null) || (fld.value == null) || (fld.value.length == 0) )
{app.alert(alert); fld.setFocus() ;return false}
else {return true}
}



// check that required fields are not empty
validate_required(“Copyright Notice”,”Please check Copyright Notice Box”);
validate_required(“Field 1”,”Please provide a Requester Name”);
validate_required(“Field 2”,”Please provide Number of Copies”);
validate_required(“Field 3”,”Please provide a Number of Originals”);

this.mailDoc({bUI:true, cTo:”e-mailadress.com”, cSubject:”Return Data”});

But the check box did not recognize. Is because the check box has its own code?
and also it shows all the worning and after we click OK, it goes to the e-mail window not leting me the chance to fill the required field
Thanks.
J.

Josman

Josman
Registered: Jul 15 2009
Posts: 31
HI Tom, Sorry but I goin back to my form proyect I did not touch it because I was busy with a beginning of the semester, I work for a Community college.
My questions is, '' I fill out my form and I left a one required field empty to test the submit botton , it recognized all the required fiels exept the check box(Check box is not required any more) but the it goes to client e-mail window so practically skip the required fields, I have to close back the e-mail client window to fill the empty required field and send it back. Is my Script missing something?
Please I need your help...This is wath I wrote

function validate_required(field,alert)
{
var fld = this.getField(field);
if( (fld == null) || (fld.value == null) || (fld.value.length == 0) )
{app.alert(alert); fld.setFocus() ;return false}
else {return true}
}
// check that required fields are not empty
validate_required(“Field 1”,”Please provide a Requester Name”);
validate_required(“Field 2”,”Please provide Number of Copies”);
validate_required(“Field 3”,”Please provide a Number of Originals”);

this.mailDoc({bUI:true, cTo:”e-mailadress.com”, cSubject:”Return Data”});


My other question is we are going to add a botton to attach a file to my form so it can be in one file , I know tha I need to have a license to make this work in Acrobat Reader, we don't want to buy a LiveCicle program, what can we do to make this happen?
Thank you I will apreciate for all your info.
J.

Josman

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
In your code the form is mailed reqardless of the validation results. You need an "if" statement to qualify sending the email, as I showed in the psuedo code in my previous post.

I'm under the impression that you can in fact purchase a single Reader Usage Right. But I don't know how this is done. You'll need to contact Adobe sales to find out. I do know that there used to be 3rd party Reader Rights venders, but I don't know anymore.

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

farquart (not verified)
I was having the same problem