title: Mob. number validation in js CRM2016
body: <p>I'm using below code for accepting +xxxxxxxxx format but I'm getting error like Cannot read property 'match' of undefined at phonenumber Can you plz suggest me where I'm committing mistake ;</p>
  
  <p>Below code:</p>
  
  <pre><code>function phonenumber() {
      var inputtxt = Xrm.Page.data.entity.attributes.get("new_phonenumber").getValue();
      var phoneno = /^+?([0-9]{2}))?[-. ]?([0-9]{4})[-. ]?([0-9]{4})$/;
      if (inputtxt.match(phoneno)) {
          return true;
          Xrm.Page.getControl("new_phonenumber").clearNotification();
      } else {
          Xrm.Page.getControl("new_phonenumber").setNotification("Format error");
          return false;
      }
  }
  </code></pre>
  
  <p>I'm refreing this :<a href="https://stackoverflow.com/questions/18375929/validate-phone-number-using-javascript/42265630#42265630">Validate phone number using javascript</a> </p>