Add test to validate digit.

Fixes backspace problem on Firefox.