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

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

New Here ,
Jul 06, 2018 Jul 06, 2018

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
485
Translate
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

Why do you create a new thread?

Your old thread:

ADOBE JAVASCRIPTS

Translate
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

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.

Translate
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

The posted code will work on Mac and PC.

Translate
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

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

Translate
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

You should continue the other thread.

Translate
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

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.  

Translate
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

Remove a.

Translate
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
LATEST

Ahhhh haaa.

Translate
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

ooops misread your reply

Translate
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

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.

Translate
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