title: Validate phone number start with 080, 081, 090, 070, 091
body: <p>I want to validate the phone number Prefix and the number of digits.</p>
  <p>The phone number would be 11 digits long (only numeric).
  The prefix must start with any of these prefixes: 080, 081, 090, 091, 070, and the max is 11 digits.</p>
  <p>I placed a validation code to validate phone number digits using the below code in my javascript and it works fine.</p>
  <pre><code>**Phone number 11 digits validation code below;**
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>} else if (form.usercheck1.value.length&lt;11 || 
     form.usercheck1.value.length&gt;11) { alert(&quot;phone number should be 11 digits!&quot;);
  }
  </code></pre>
  
  <p><strong>But I need help to validate phone prifix.</strong>
  Any help would be appreciated.</p>
  <p>my complete javascript code below;</p>
  <pre><code>/* myScript.js */
  function check(form) /*function to check userid &amp; password*/ {
    /*the following code checkes whether the entered userid and password are matching*/
    if (form.usercheck1.value == &quot;1234&quot; ||
      form.usercheck1.value == &quot;12345&quot;)  {
        alert(&quot;An account already exist with this phone number! \nKindly login to proceed.&quot;) // displays error message
      } else if (form.usercheck1.value.length &lt; 11 || form.usercheck1.value.length &gt; 11) {
        alert(&quot;phone number should be 11 digits!&quot;);
      } else {
        window.location.replace('https://www.google.com')
        /*opens the target page while Id &amp; password matches*/
      }
    }
  }
  </code></pre>