improve checking for numeric characters in javascript
fix handling of numbers in php

closes #110