updateElementStatus() method
Update the element status
updateElementStatus(field: String, ele: HTMLElement, status: String, validator: String): Core
(* denotes a required parameter)
| Parameter | Type | Description |
|---|
field* | String | The field name |
ele* | HTMLElement | The field element |
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 in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.updateElementStatus(...);
Using with ES6 module
import formValidation from 'formvalidation/dist/es6/core/Core';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.updateElementStatus(...);