Added client-side validation to the register form