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

ErrorMessageInterface

Fields available on ErrorMessageInterface.

PropertyTypeRequired
message`string \number \
typestringoptional
codenumberoptional
data`null \string \
Usage
Example: Handling an Error Message using the Validate API function
const myForm = document.getElementById("myForm"); nfsfu234FormValidation.validate(myForm, (response) => { /** * Example of using the ErrorMessageInterface * * Here the response is in the ErrorMessageInterface formart so we destructure the ErrorMessageInterface * This enables us to to access its attributes and use them easily */ const { message, type, data, code } = response; console.log("Code: ", code); console.log("Message: ", message); console.log("Type: ", type); console.log("Data: ", data); });
Used by
Last updated on