form validation bug fix

the comparison for min/max was sometimes not working. It was
inconsistent but converting the value to a number has fixed the issue.