Added form validation for registration page.