DHTMLX Docs & Samples Explorer

Index
dhtmlxdataprocessor
Validation

## Validation

Grid allows to define validators which will be activated before data sending.
dp.setVerificator(index,method);

- index - index of column for which verificator will be assigned;
- method - verificator function.

Verificator function is a function which will receive the following parameters:

- value of cell;
- id of row;
- index of columns.

Function based on such values must return true or false to accept or deny value. If any value was denied during validation, data sending will be blocked and onValidatationError event generated

Inside verificator function, “this” points to the object, to which dataprocessor attached ( grid or tree )

### Validate message

If you need to collect all validation errors and output a single error message it can be done by returning a text message from validation function instead of false. You can check 07_basic_validation_with_message.html sample, inside dataprocessor's package, for more details.