Javascript IndexOf with integers in string not working
<p>Can anyone tell me why does this not work for integers but works for characters? I really hate reg expressions since they are cryptic but will if I have too. Also I want to include the "-()" as well in the valid characters.</p>

<pre><code>String.prototype.Contains = function (str) {  
    return this.indexOf(str) != -1;
};

var validChars = '0123456789';               

var str = $("#textbox1").val().toString();
if (str.Contains(validChars)) {
    alert("found");
} else {
    alert("not found");
}
</code></pre>
