TIWCGJQValidateOptions.AddMethod(string,string) Method

Procedure allow to add the custom methods of validations.

Namespace: IWCGJQControl
public
 procedure AddMethod(const AMethodName, AFuncJS: string); overload;

Parameters

AMethodName
Type: string

The method name

Note

You need to set the TIWCGJQValidateOptionsRule.CustomRule property with the method name.

AFuncJS
Type: string

Javascript function.

Example of method of minWord validator:

function(value, element, params) {
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
}