added red border to fields that didn't pass validation

also 
- re factored code a bit
- added check for number field to check if it is a number and not a string