title: Unable to get value of the property 'match': object is null or undefined
body: <p>I'm getting "Unable to get value of the property 'match': object is null or undefined" when the function below works. The interesting part is that it is working perfectly on another page. Any ideas?</p>
  
  <pre><code>function valPoBox(sender, args) {
      var hasPObox = /^[P|p]*(OST|ost)*\.*\s*[O|o|0]*(ffice|FFICE)*\.*\s*[B|b][O|o|0][X|x]\s*(\d.)*/gi;
      var StreetAddress = $('.streetaddress').val();
  
      if (StreetAddress.match(hasPObox)) {
          args.IsValid = false;
  
          sender.ErrorMessage = "Address must not contain P.O. Box";
          $('.valPoBox').attr("ErrorMessage", sender.ErrorMessage);
      }
      else {
          args.IsValid = true;
      }
  
  }
  </code></pre>