Class: Form

JSValidator. Form

new Form(formElement, validator)

Parameters:
Name Type Description
formElement HTMLFormElement The HTML form element
validator JSValidator The current validator
Properties:
Name Type Description
fields JSValidator.Field[] All the form Fields
Source:

Methods

addFieldsPostValidationAfterMessageProcess(fn) → {JSValidator.Form}

FORM SCOPE API: add global postvalidation process after messages display (on all the fields)
Parameters:
Name Type Description
fn function The callback to execute behind the action
Source:
Returns:
Type
JSValidator.Form

addFieldsPostValidationBeforeMessageProcess(fn) → {JSValidator.Form}

FORM SCOPE API: add global postvalidation process before messages display (on all the fields)
Parameters:
Name Type Description
fn function The callback to execute behind the action
Source:
Returns:
Type
JSValidator.Form

addFieldsPreValidationProcess(fn) → {JSValidator.Form}

FORM SCOPE API: add global prevalidation process (on all the fields)
Parameters:
Name Type Description
fn function The callback to execute behind the action
Source:
Returns:
Type
JSValidator.Form

getFields() → {JSValidator.Field[]}

Getter for all the form Fields
Source:
Returns:
Type
JSValidator.Field[]

getFieldWithName(fieldName) → {JSValidator.Field}

Getter for a Field with name
Parameters:
Name Type Description
fieldName String
Source:
Returns:
Type
JSValidator.Field

getValue(fieldName) → {String|Array.<String>}

Get the value of a specific field
Parameters:
Name Type Description
fieldName String
Source:
Returns:
Type
String | Array.<String>