title: checking cell number and clear the text from the textbox in JavaScript
body: <p>This is my problem I created a textbox to check U.S cellphone number and a function in JS that check numbers only. the problem is after I enter wrong number and I want to clear the textbox the function in JS won't let me it just delete everthing instad of using backspace and delete one char each time.It won't work on firefox why??? and when I click on star in the keyboard it deleting everything why is that????</p>
  
  <p>This my code:</p>
  
  <pre><code>function NumbersOnly(sender, args) {
      var text = sender.get_value() + args.get_keyCharacter();
      if (!text.match('^[0-9]+$') &amp;&amp; text != '\b' &amp;&amp; text != '(' &amp;&amp; text != ')' &amp;&amp; text != '-') {
          args.set_cancel(true);
      }
  }
  </code></pre>
  
  <p>
                  
                      Cell:</p>
  
  <pre><code>            &lt;/td&gt;
              &lt;td style="text-align: left"&gt;
              &lt;telerik:RadTextBox ID="txtPhone" runat="server" MaxLength="25" Width="200px"&gt;&lt;ClientEvents OnKeyPress="NumbersOnly"&gt;&lt;/ClientEvents&gt;&lt;/telerik:RadTextBox&gt;                
              &lt;asp:RegularExpressionValidator runat="server" ID="revPhone"
                              ControlToValidate="txtPhone"
                              Display="None"
                              ValidationExpression="^(\([0-9]{3}\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$"
                              ValidationGroup="validateEditUser"
                              EnableClientScript="false"
                              ErrorMessage="- Please enter a valid phone number:(ex.) &lt;b&gt;(xxx-xxx-xxxx)&lt;/b&gt;&lt;/br&gt;" /&gt;
          &lt;/tr&gt;
  </code></pre>
  
  <p>Thanks  </p>