enableValidator() method

Enable particular validator for given field
enableValidator(field: String, validator: String): Core
(* denotes a required parameter)
ParameterTypeDescription
field*StringThe field name
validatorStringThe validator name. If it isn't specified, all validators will be enabled
Using the global script in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.enableValidator(...);
Using the ES6 module
import { formValidation } from '/path/to/@form-validation/cjs/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.enableValidator(...);
Using the npm package
import { formValidation } from '@form-validation/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.enableValidator(...);
The core.validator.enabled event is triggered after the enableValidator method is called.

See also