updateElementStatus() method

Update the element status
updateElementStatus(field: String, ele: HTMLElement, status: String, validator: String): Core
(* denotes a required parameter)
ParameterTypeDescription
field*StringThe field name
ele*HTMLElementThe field element
status*StringThe new status
validatorStringThe validator name. If it isn't specified, all validators will be updated
The status parameter can be one of the following value:
ValueDescription
'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(...);