DHTMLX Docs & Samples Explorer

bindValidator(input, validator)

Bind validation rule to the input

  • input - object or ID of input element
  • validator - can be predefined name of validation rule, name of custom function, or regexp string
dhxForm.bindValidator("someId", "NotEmpty");
function my_check(value){
   return some_check(value);
   }
dhxForm.bindValidator("someId", "my_check");
dhxForm.bindValidator("someId", "[0-9]{1-4}");