Performs validation of fields in a form