Skip to Content
NFSFU234FormValidation v3 is here — file upload validation, config-driven rules, and more.
v3 (current)validateSelect

validateSelect

Validates a single <select> field. Returns: boolean \| ErrorMessageInterface

ParameterTypeRequiredDefaultDescription
selectFieldHTMLSelectElementrequired-The select element to validate.
optionsanyrequired-Overrides for the field’s validation rule (e.g. required).
callbackanyrequired-Optional callback invoked with the result.
Usage
Example: Validate a Select Input
// Using with a select input element const selectElement = document.querySelector('select'); const result = nfsfu234FormValidation.validateSelect(selectElement, { message: 'Please select an option from the dropdown.' }, (response) => { console.log(response); }); console.log(result);
Last updated on