focusToErrorAfterSubmit parameter is used to automatically focus to the first element with a validation error. In order to find the element on DOM, path value should be equal to the HTML element ID. If DOM element ID is different than path value, then the DOM element ID should be passed as elementId param to the rule definition.
Validation Result:
valid
![validationresult](/react-validatable-form-demo/valid.png)
Current Rules
[
{
"path": "textVal1",
"ruleSet": [
{
"rule": "required"
}
]
},
{
"path": "textVal2",
"ruleSet": [
{
"rule": "required"
},
{
"rule": "length",
"greaterThanOrEqualTo": 7
}
]
},
{
"path": "val3",
"ruleSet": [
{
"rule": "required"
},
{
"rule": "listSize",
"equalTo": 2
}
]
},
{
"path": "textVal4",
"ruleSet": [
{
"rule": "required"
},
{
"rule": "url"
}
]
}
]