Toggle menu

helper.validateField(fieldName, currentForm, failureArray)

This function validates the contents of a single field.

The function is supplied with the name of the field and a DOM element, or its server-side equivalent, that represents the current form. It should return true if the field is valid. If the field is invalid it should return false and append a validation failure result object to the supplied array.

Arguments

ArgumentTypeDescription
fieldNameString, requiredThe name of the field to validate
currentFormObject, requiredDOM-style object for the current form
failureArrayArray, requiredAn array of validation errors

Returns

Boolean

Last modified on 6 August 2021

Share this page

Facebook icon Twitter icon email icon

Print

print icon