Skip to content

Model Object

clearErrors()

clearErrors() — returns void

Available in: model Category: Error Functions

Clears out all errors set on the object or only the ones set for a specific property or name.

NameTypeRequiredDefaultDescription
propertystringno—Specify a property name here if you want to clear all errors set on that property.
namestringno—Specify an error name here if you want to clear all errors set with that error name.
// 1. Clear all errors on the object
this.clearErrors();

// 2. Clear all errors set on the `firstName` property
this.clearErrors(property="firstName");

// 3. Clear only errors that were set with a specific error name
this.clearErrors(name="invalidFormat");

// 4. Clear errors on a specific property that were also set with a specific name
this.clearErrors(property="email", name="duplicateEmail");