Form validation and messages callback