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

Adding additonal javascript acction to existing javascript on PC with ADOBE Acrobat PRO XI

New Here ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

PC, Windows 10, Adobe Acrobat PRO XI

var patternEmpty = /^\s*$/;

var strMissing = "";

if(patternEmpty.test(this.getField("1st
purchaser").value))

     strMissing =
"1st purchaser";

  { // All is ok,
submit the data

  1. console.println("All form data ok");

  }

if(strMissing.length)

{// Got an error

  1. app.alert("Please complete 1st Purchaser: " +
    strMissing);

}

this is the script currently in use and is functioning as desired.  I want to add an action that when the approver hits the submit button it will cc: the email address entered in the EMAIL field completed by the originator of the form?

TOPICS
Acrobat SDK and JavaScript

Views

311

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

Why do you create a new thread?

Your old thread:

ADOBE JAVASCRIPTS

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

I got one response to the older one however when I informed them I was on a PC and that the response was not working as the response was for a MAC the replies stopped....  So I thought rewording it with the computer info would get me a correct solution.

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

The posted code will work on Mac and PC.

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

I will try it again but I seem to recall that if an address was in the email field the validation ignored the required field and the form could be sent....  I will test once more and provide my results

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

You should continue the other thread.

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

That is what I was thinking but when I attempt to add the

var cToAddr = " Pcardreceipts@ifas.ufl.edu"

var cCCAddr = this.getField("Email").value; 

var cSubLine = "P-CARD RECIEPT FORM SUBMITTED FOR PROCESSING "

var cBody = "Thank you for submitting your form.\n" + "Save the mail attachment for your own records"

  1. this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody}); 

}

it doesn't like it I get an error on line 8 but there isn't anything on line 8 or I get a syntax error.  

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

Remove a.

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

LATEST

Ahhhh haaa.

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

ooops misread your reply

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 ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

var patternEmpty = /^\s*$/; var strMissing = ""; if(patternEmpty.test(this.getField("1st purchaser").value)) 

     strMissing = "1st purchaser";     { // All is ok, submit the data  console.println("All form data ok"); 

  } 

if(strMissing.length) 

{// Got an error 

  1. app.alert("Please complete 1st Purchaser: " + strMissing); 

else

var cToAddr = " Pcardreceipts@ifas.ufl.edu"

var cCCAddr = this.getField("Email").value; 

var cSubLine = "P-CARD RECIEPT FORM SUBMITTED FOR PROCESSING "

var cBody = "Thank you for submitting your form.\n" + "Save the mail attachment for your own records"

  1. this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody}); 

}

I am pasting this into the javascript as displayed.

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