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 the global script in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.updateElementStatus(...);
Using the ES6 module
import { formValidation } from '/path/to/@form-validation/cjs/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.updateElementStatus(...);
Using the npm package
import { formValidation } from '@form-validation/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.updateElementStatus(...);