validateAllSelect
Validates every <select> field in the form.
Returns: boolean \| ErrorMessageInterface \| ErrorMessageInterface[]
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
form | `HTMLFormElement \ | HTMLDivElement` | required | - |
options | any | required | - | Custom error messages / overrides keyed by field name. |
Usage
Example: Validate All Select Inputs in a Form
const formElement = document.getElementById('myForm');
const result = validateAllSelect(formElement, {
message: 'Please select an option from all dropdowns.'
});
console.log(result);Last updated on