Jun 9th, 2011, 12:42 PM
Additional form validation
Forgive me if this seems like a silly question. However, I have been googling for some time on this subject.
I was wondering about the best way to add additional form validation and error message handling. For example, if I have a column that is a number, what is the best way to present a pretty error message if the user enters characters?
I looked into custom validation through the ConstraintValidator interface. For this kind of validation, this does not appear to be the correct methodology.
I am looking to do add pretty user error messages if:
- Entry in form should be a number and user enters characters
- Unique constraint violations
- Database issues such as connection errors
- User tries to delete a child that has a parent assigned
What is the best methology for adding these kinds of validations?