2 Replies Latest reply on Dec 15, 2017 12:09 PM by SIPRNet11

    Certain text in a field


      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?