Updated javascript and form validation for registration form.