{hero}

inError()

Since: Editor 1.5

Determine if there is an error condition displayed in the form.
Please note - this property requires the Editor extension for DataTables.

The full Editor reference documentation is available to registered users of Editor - the information shown below is a summary only. If you already have an Editor license please , alternatively an Editor license can be purchased on this site, or sign up for the free trial.

Description

This method can be used to determine if an error message is being shown to the end user. The form error message (error()) is always checked and the optional parameter can be used to determine what fields, if any are checked. The main form error message can be checked alone by passing in an empty array.

Please note that this method does not itself perform any validation, it just checks the form and the fields in the form to determine if any of them are in an error state.

Additionally, when Editor submits the form (i.e. submit()) it will clear any existing errors at that point. This is to allow any validation (client or server-side) to run on the freshly submitted form data. The upshot of this is that inError(), if used as the first call inside preSubmit would not show any errors, since the errors have been cleared. In this case of client-side validation, preSubmit would be expected to set the errors.