form validation and shake animation