Copy link to clipboard
Copied
I have tried so many different ways, that I finally decided to break down and ask the "experts"! I have a text field where users will input what organization they are with. I have a popup window "On Focus" that tells the user if they are working for our organization, to input our company name "XYZ"; Otherwise, input whatever. Later on in the form, there's a submit button to email the PDF form. If that text field has XYZ G6, it'll send an email to a certain group of people; Otherwise, if that text field doesn't have that key word (XYZ), it sends the email to a different group of people. Here's what I've been working with:
var sendTo = "john.doe@mail.com";
var sendOther = "bill.jones@mail.com";
var keyWord = this.getField("20 Supervisors Organization").startsWith("XYZ);
if (this.getField("31 Sec Mgr Sig").value != "" && keyWord == true) {
this.mailDoc({bUI:true, cTo:sendTo...
} else if (this.getField("31 Sec Mgr Sig").value != "" && keyWord == false) {
this.mailDoc({bUI:true, cTo: SendOther...
I've tried includes(), valueOf(), and other String Methods, but none of them are working. Am I even going the right route?
Replace line #3 with:
var keyWord = this.getField("20 Supervisors Organization").valueAsString.indexOf("XYZ")==0;
Copy link to clipboard
Copied
Replace line #3 with:
var keyWord = this.getField("20 Supervisors Organization").valueAsString.indexOf("XYZ")==0;
Copy link to clipboard
Copied
Gilad,
I can't wait to have just 1/8th the knowledge you have with javascript! Thanks!! Have a great weekend and Merry Christmas!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now