added feature so that data will only be submitted to the database if there are no errors, the fields entered are a subset of the database table and the fields entered are not empty (technically a subset)