3 Replies Latest reply on Oct 20, 2017 7:04 AM by try67

    Validating an email address with more than one domain name and eliminating the rest

    SIPRNet11 Level 1

      I would like to validate an email address using more than one specific domain name.  My current code (which I found here) for validating an email address with one specific domain name is:

       

      (function (){
      var sDomain = "mail.mil";
      if(!event.value) return;
      var sEnteredDomain = event.value.split("@")[1];
      if (typeof sEnteredDomain === "undefined" || sEnteredDomain.toLowerCase() !== sDomain){
      event.rc = false;
      app.alert("Your email address must end with:  " + sDomain, 3);
      }
      })();
      

       

       

      FYI: I am using this code in a PDF form.