Dynamic Email submission with variable fields button does not click
I have submit button on a form that when clicked it sends a PDF attachement to a static mailto, with the cc, subject line, and body all based on a field entry.
I based my code on this link:
https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address/
As a result this is my code.
var cToAddr = "application@email.com";
var cCCAddr = this.getField("Employee_Email").value;
var cSubLine = "Application for" + this.getField("Employee_Name").value;
var cBody = this.getField("Employee_Name").value + "has submitted an Application for review.";
event.target.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody});
It appears my code is just wrong. I've tried alternate variations but this seems to be the closest. The Javascript Debugger says:
Acrobat EScript Built-in Functions Version 10.0
Acrobat SOAP 10.0
SyntaxError: missing } after property list
4:
SyntaxError: missing } after property list
4:
SyntaxError: unterminated string literal
7:
SyntaxError: unterminated string literal
7:
SyntaxError: unterminated string literal
3:
SyntaxError: unterminated string literal
3:
SyntaxError: unterminated string literal
3:
SyntaxError: unterminated string literal
3:
SyntaxError: unterminated string literal
3:
SyntaxError: unterminated string literal
3:
SyntaxError: unterminated string literal
3:
SyntaxError: unterminated string literal
3:
SyntaxError: unterminated string literal
3:
TypeError: event.target.mailDoc is not a function
5:Field:Mouse Up
TypeError: event.target.mailDoc is not a function
5:Field:Mouse Up
TypeError: event.target.mailDoc is not a function
5:Field:Mouse Up
TypeError: event.target.mailDoc is not a function
1:Field:Mouse Up
TypeError: event.target.mailDoc is not a function
1:Field:Mouse Up
TypeError: event.target.mailDoc is not a function
1:Field:Mouse Up
Clearly the MouseUp function doesn't like the code, though it's what I want to happen. Click on the button and it submits like this would:
this.submitForm({cURL: "mailto:application@email.com", cSubmitAs: "PDF"});
At this point, I'm at a loss of how to make this function properly.
