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

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

129

Likes

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

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

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

130

Likes

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

Copy link to clipboard

Copied

Why do you create a new thread?

Your old thread:

ADOBE JAVASCRIPTS

Likes

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
Reply
Loading...
Jul 06, 2018 0
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.

Likes

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
Reply
Loading...
Jul 06, 2018 0
Jul 06, 2018

Copy link to clipboard

Copied

The posted code will work on Mac and PC.

Likes

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
Reply
Loading...
Jul 06, 2018 0
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

Likes

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
Reply
Loading...
Jul 06, 2018 0
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.

Likes

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
Reply
Loading...
Jul 06, 2018 0
Jul 06, 2018

Copy link to clipboard

Copied

You should continue the other thread.

Likes

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
Reply
Loading...
Jul 06, 2018 0
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.  

Likes

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
Reply
Loading...
Jul 06, 2018 0
Jul 06, 2018

Copy link to clipboard

Copied

ooops misread your reply

Likes

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
Reply
Loading...
Jul 06, 2018 0
Jul 06, 2018

Copy link to clipboard

Copied

Remove a.

Likes

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
Reply
Loading...
Jul 06, 2018 0
Jul 06, 2018

Copy link to clipboard

Copied

Ahhhh haaa.

Likes

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
Reply
Loading...
Jul 06, 2018 0