Sets the error of the specified field or field array.

setError(form, name, error, options);


  • form FormStore
  • name string
  • error string
  • options object = {}
    • shouldFocus boolean = true


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.