make submit button check to see if data entered is valid