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

validate

Validates the whole form (every input, textarea, select, radio, checkbox, and file field) without submitting it. Returns: Promise<false \| ErrorMessageInterface>

ParameterTypeRequiredDefaultDescription
userOptionsFormConstructorInterfaceoptional-Overrides the form/customErrorMessages configured on this instance.
callbackobjectoptional-Optional callback invoked with the validation result.
Usage
Option 1.
const myForm = document.getElementById("myForm") nfsfu234FormValidation.validate(form) .then((response) => { const { message, type, data } = response; console.log(response); });
Option 2.
const myForm = document.getElementById("myForm"); nfsfu234FormValidation.validate(myForm, (response) => { const { message, type, data } = response; console.log(response); });
Last updated on