Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Livecycle Designer - Javascript

$
0
0

We have a form that was created in LivecycleDesinger ES2 some time ago and we want to create a very similar form in LivecycleDesinger ES4, in particular a "submit" button that utilizes javascript.  I created a new "submit" button using LivecycleDesinger ES4.  I copied the javascript from the form created in LivecycleDesinger ES2 into LivecycleDesinger ES4.  When we open the form in Acrobat Pro XI and select the "submit" button, we get a window entitled "Check Names" that opens and reads Microsoft Outlook does not recognize "1.  Double-click the attachment."  Also get an error from the javascript debugger when previewing in PDF.  As a brand new user to Livecycle Designer, was hoping a simple copy and paste would work. 

 

Check Names.jpg

Check Names 2.jpg

 

Below is the script, how can I correct?

 

topmostSubform.Page1.Button2::click - (JavaScript, client)

//@@SUBMITURL "mailto:christopher.fagan@mascocabinetry.com?subject=Submitting Completed Form&body=Instructions to add this form to a responses file:\n1. Double-click the attachment.\n2. Acrobat will prompt you to select a responses file.&ui=false"

 

/**************************************************************

AdobePatentID="B643"

**************************************************************/

var AdobePatentID = "AdobePatentID=\"B643\"";

 

// initiate some constants

var METADATA_ANNOT_NAME     = "adhocFormState";

var PROP_RESPONDENT_NAME    = "respondentName";

var PROP_RESPONDENT_EMAIL   = "respondentEmail";

 

var currentDoc;

if (typeof(xfa) == "object")

    currentDoc = event.target;

else

    currentDoc = this;

 

// Only on Viewer/Reader older than 9.0, we'll do the following tasks.

var bAnonymous = false;

var bContinue = true;

if (app.viewerVersion < 9.0) {

 

    // show the email/name dialog if not anonymous

    if (!bAnonymous && !currentDoc.dynamicXFAForm) {

        var result = currentDoc.askUserIdentity(currentDoc);

        if (result == null)

            bContinue = false;

        else {   

            var annot = currentDoc.getAnnot(0, METADATA_ANNOT_NAME);

            if (annot != null) {

                var arrProps = new Array();

                arrProps = annot.contents.split(";");

                currentDoc.setProperty(arrProps, PROP_RESPONDENT_NAME, result.name);

                currentDoc.setProperty(arrProps, PROP_RESPONDENT_EMAIL, result.email);

                annot.contents = arrProps.join(";");

            }

        }

    }

   

    // show the select client dialog

    if (bContinue) {

        var result = currentDoc.askEmailClient(currentDoc);

        if (result == null)

            bContinue = false;

        else if (!result.send)  {

            app.execMenuItem("SaveAs");

            bContinue = false;

        }

    }

}

 

// submit the form

if (bContinue) {

    var rawURL = "christopher.fagan@mascocabinetry.com?subject=Submitting Completed Form&body=Instructions to add this form to a responses file:\n1. Double-click the attachment.\n2. Acrobat will prompt you to select a responses file.&ui=false";

    var submitURL;

    if (app.viewerVersion < 9.0)

        submitURL = "mailto:" + rawURL;

    else

        submitURL = "mailto:" + escape(rawURL);

    currentDoc.submitForm({

        cURL: submitURL,

        cSubmitAs: "PDF"

    });

}

 


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>