To set a handler for the ui:validationError event, use the onError system attribute on a component that extends ui:input, such as ui:inputNumber.
<aura:component> Enter a number: <!-- onError calls your client-side controller to handle a validation error --> <!-- onClearErrors calls your client-side controller to handle clearing of errors --> <ui:inputNumber aura:id="inputCmp" onError="{!c.handleError}" onClearErrors="{!c.handleClearError}"/> <!-- press calls your client-side controller to trigger validation errors --> <ui:button label="Submit" press="{!c.doAction}"/> </aura:component>
Attribute Name | Type | Description |
---|---|---|
errors | Object[] | An array of error messages |