JS regex to replace any non numeric char or decimal
Posted: Wed Oct 25, 2006 4:02 pm
Code: Select all
<script>
function removeIt(obj)
{
obj.value = obj.value.replace(/(\D|^\.)/,'');
}
</script>so:
$53 would change to 53
and:
$53.00 would change to 53.00
etc.