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

validateAllTextarea

The validateAllTextarea function validates all textarea inputs within a specified form. It returns an array of error messages (a nested ErrorMessageInterface) or a single instance of ErrorMessageInterface if all fields are valid..

Works in: HTML5, React JS

ParameterTypeDefaultDescription
formHTMLFormElement | HTMLDivElement | stringundefinedThe form element or its ID containing textarea inputs.
optionsobject{}Optional settings for validation such as custom error messages.

Usage

Example: Validate All Textarea Inputs in a Form

const formElement = document.getElementById('myForm'); const result = nfsfu234FormValidation.validateAllTextarea(formElement, { message: 'Please provide valid input in all textareas.' }); console.log(result);

See also

Last updated on