validation for number and date fields