revalidateField() method

Revalidate a particular field
revalidateField(field: String): Promise
(* denotes a required parameter)
ParameterTypeDescription
field*StringThe field name
This method is useful when the field value is effected by third parties (for example, attach another UI library to the field). Since there isn't an automatic way for FormValidation to know when the field value is modified in those cases, we need to revalidate the field manually.
Using in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv
.revalidateField(...)
.then(function(status) {
// status can be one of the following value
// 'NotValidated': The field is not yet validated
// 'Valid': The field is valid
// 'Invalid': The field is invalid
...
});
Using with ES6 module
import formValidation from 'formvalidation/dist/es6/core/Core';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv
.revalidateField(...)
.then(function(status) {
// status can be one of the following value
// 'NotValidated': The field is not yet validated
// 'Valid': The field is valid
// 'Invalid': The field is invalid
...
});
Look at the Integration page to see more examples.

See also