ItemError

Description

Occurs when a field has been modified, the field loses focus (for example, the user presses Enter, Tab, or an arrow key or clicks the mouse on another field in the DataWindow), and the data in the field does not pass the validation rules for its column.

Argument

Description

sender

Object. The source of the event.

row

Number. The number of the row containing the item whose new value has failed validation.

columnName

String. The name of the column containing the item.

newValue

String. The new data the user has specified for the item.

Applies to

Web DataWindow client control

Returns

Set the return code to affect the outcome of the event:

Usage

If the Return code is 0 or 1 (rejecting the data), the field with the incorrect data regains the focus.

The ItemError event occurs instead of the ItemChanged event when the new data value fails a validation rule. You can force the ItemError event to occur by rejecting the value in the ItemChanged event.

Examples

Example 1

This script in the .aspx file displays an alert message:

function objwdw_ItemError(sender, rowNumber, columnName, newValue) {
   alert("ItemError: " + rowNumber + columnName +    newValue);
}

See also