title: Test Int value in Javascript (Regular Expression)
body: <p>I have a javascript function which matches the text entered in an Ajax Combobox against a regular expression.
  But seems like 'test' is not working as expected.
  Below is my code and I am not getting where I am doing wrong.</p>
  
  <pre><code> &lt;script language="javascript" type="text/javascript"&gt;
      function cmbExample_OnBlur() {
          var regex = "^[0-9]{1,10}$";
          var sel = document.getElementById("MainTextBox").value;
          alert(sel);
          if (regex.test(sel)) {
              alert("success");
          }
          else {
              alert("error");
          }
  
      }
  </code></pre>
  
  <p>
  I tried converting sel into string then also it is not working.</p>