Added client-side validation using javascript