-
Notifications
You must be signed in to change notification settings - Fork 0
Validation Strategies
romagny13 edited this page Jul 8, 2017
·
1 revision
Validate all on form Submission:
- create a state variable
submitted(boolean) for example - handle
onSubmitand setsubmittedto true on submit - check if is
submittedonValueChangeto validate all or only the form element value - check on each form group form is
submittedto setcanChangeValidationState
... or when a form element is touched, validate all or only the element value
- create a state variable
touched(object with names of form element touched) for example - handle
onTouchon form element components and settouchedwith the name passed - check all errors or only for the form element
onValueChange - check on each form group if the form element component is
touchedto setcanChangeValidationState
... other scenarios