title: If the validation of textbox fails it should be in same textbox and restrict user to move to another textbox
body: <p>In the below code i have a javascript function and a textbox.The validations are working perfectly.My aim if the validation fails it should clear the textbox value and cursor should be in the same textbox it should not move to other controls.</p>
  
  <p>JS:</p>
  
  <pre><code>function ValidateRegExp(txtInput, REGEXP) {
      var mySplitResult = new Array();
      mySplitResult = REGEXP.split("~~");
  
      var iReturn = 0;
      for (i = 0; i &lt; mySplitResult.length - 1; i++) {
  
          var re = new RegExp(mySplitResult[i]);
          if (!txtInput.match(re)) {
              iReturn = iReturn + 1;
          }
      }
  
      if (iReturn &gt; 0) {
          alert("Failed...");
      } else {
          alert("Success...");
      }
  
  }
  </code></pre>
  
  <p>codebehind:</p>
  
  <pre><code> txtField.Attributes.Add("onblur", "javascript:ValidateRegExp(document.getElementById('" + txtField.ClientID + "').value, '" + hidRegExp.Value + "');");
  </code></pre>