updateFieldStatus() method
Update the field status
updateFieldStatus(field: String, status: String, validator: String): Core
(* denotes a required parameter)
Parameter | Type | Description |
---|
field * | String | The field name |
status * | String | The new status |
validator | String | The validator name. If it isn't specified, all validators will be updated |
The status
parameter can be one of the following value:
Value | Description |
---|
'NotValidated' | The field is not yet validated |
'Valid' | The field is valid |
'Invalid' | The field is invalid |
Using the global script in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.updateFieldStatus(...);
Using the ES6 module
import { formValidation } from '/path/to/@form-validation/cjs/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.updateFieldStatus(...);
Using the npm package
import { formValidation } from '@form-validation/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.updateFieldStatus(...);
See also