adding validity modes to textfield