enable form validation and display error message in the form