validateAllRadio
Validates every radio group in the form.
Returns: boolean \| ErrorMessageInterface \| ErrorMessageInterface[]
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
form | `HTMLFormElement \ | HTMLDivElement` | required | - |
customErrorMessage | any | required | - | Custom error messages keyed by radio group name, overriding the defaults. |
Usage
Example: Validate All Radio Button Groups in a Form
const formElement = document.getElementById('myForm');
const result = nfsfu234FormValidation.validateAllRadio(formElement, {
message: 'Please select an option for all required questions.'
});
console.log(result);Last updated on