Adding validation to the form.