-- DigitsOnly gets rid of anything but digits -- script type text java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<!-- DigitsOnly() gets rid of anything but digits -->
<script type="text/javascript">
function DigitsOnly(text)
{
var ch, digits;
digits = "";
for (i=0; i<text.length; i++) {
ch = text.charAt(i);
if (ch >= "0" && ch <= "9") {
digits += ch;
}
}
return digits;
}
</script>