Added client-side validation.