I want to replace everything except 0-9 . + -
Everything else gone. This is what I have so far, but its not taking out the a-zA-Z
What am I doing wrong?
function clearChar() {
document.adjustment.adjustAmount.value=filterNum(document.adjustment.adjustAmount.value)
function filterNum(str) {
re = /\$|[a-zA-Z]|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\=|\[|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|/g;
return str.replace(re, "");
}
}
Everything else gone. This is what I have so far, but its not taking out the a-zA-Z
What am I doing wrong?
function clearChar() {
document.adjustment.adjustAmount.value=filterNum(document.adjustment.adjustAmount.value)
function filterNum(str) {
re = /\$|[a-zA-Z]|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\=|\[|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|/g;
return str.replace(re, "");
}
}