javascript: validate number input