• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Submit Button Action

New Here ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

I have an editable .pdf form that has a Submit button with a Java script running to send the completed form to a specific email address in our company.  I need to change the email address to another.  I have changed the script to the appropriate email address but that does not change the function on the form, it still submits the old form name to the old address.  It is possible that the script is not running, but where else would it be getting its direction from?  I am unable to see where else this data should be changed.  Please HELP!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

356

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

That's strange... Is the "Run a JavaScript" command the only one associated with the field?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

Yes, as far as I can see.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

Can you share the file in question with us (via Dropbox, Google Drive, Adobe Cloud, etc.)?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

Can you post the code you're using?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

Here is the Java script that was created for this document.  Unfortunately, I am not the creator and I only know enough about code to find and replace items but not really read it nor write it.  

The original email address said Gina@#####.com  and I changed it to jobs@####.com and I changed Submitting Completed Form to Submitting Completed Application.

//@@SUBMITURL "mailto:jobs@#####.com?subject=Submitting Completed Application&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 = "jobs@#####.com?subject=Submitting Completed Application&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"

    });

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

Not sure what to tell you... It seems fine.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

Yes, it didn't make sense to me, hence the plea for help!

Thank you for trying anyway. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

LATEST

Can you share the actual file?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines