revalidateField() method
Revalidate a particular field
revalidateField(field: String): Promise
(* denotes a required parameter)
Parameter | Type | Description |
---|
field * | String | The 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) {
...
});
Using with ES6 module
import formValidation from 'formvalidation/dist/es6/core/Core';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv
.revalidateField(...)
.then(function(status) {
...
});
See also