validate the fields in posted forms