getElementValue() method
Return the element value
The element value might be modified by the
field-value
filter, via the
Transformer plugin, for example
getElementValue(field: String, ele: HTMLElement, validator: String): String
(* denotes a required parameter)
Parameter | Type | Description |
---|
field * | String | The field name |
ele * | HTMLElement | The field element |
validator | String | The validator name |
Using the global script in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
const elementValue = fv.getElementValue(...);
Using the ES6 module
import { formValidation } from '/path/to/@form-validation/cjs/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
const elementValue = fv.getElementValue(...);
Using the npm package
import { formValidation } from '@form-validation/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
const elementValue = fv.getElementValue(...);