Class: JSValidator

JSValidator

new JSValidator(name, formObjectName, rules, config)

Parameters:
Name Type Description
name string The form id in the page
formObjectName string the full qualified object name on server side, mandatory for AJAX validation
rules JSValidator.Rule[] The JSON rule array
config JSON The Extra config for override default config
Properties:
Name Type Description
form JSValidator.Form The binding form
Source:

Classes

Element
Field
FieldViolation
Form
Rule
RuleViolation

Members

<static> defaultConf :Object

Default conf for the validator
Type:
  • Object
Source:

Methods

bindValidationToElement(elementId, eventType, preventDefaultOnFail) → {*}

SCOPE ELEMENT API: bind validation to external HTML Element
Parameters:
Name Type Description
elementId String
eventType String Event type (keypress, click, submit, etc.)
preventDefaultOnFail boolean True: Cancel event there has failed rules
Source:
Returns:
Type
*

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

getForm() → {JSValidator.Form}

Getter for the form binded to the current validator
Source:
Returns:
Type
JSValidator.Form

log(msg)

Logger for JSValidator, log only if prop debug is set at TRUE
Parameters:
Name Type Description
msg String Message
Source: