setError
Sets the error of the specified field or field array.
setError(form, name, error, options);
Parameters
formFormStorenamestringerrorstringoptionsobject ={}shouldFocusboolean =true
Explanation
If you have specified the name of a field, its HTML element is focused by default to make it easier for the user to respond to the error. To change this behavior, you can set shouldFocus to false.