PHP2Go Javascript Framework

Class FormValidator

Object
   |
   +--FormValidator

class FormValidator

Defined in validator.js


Field Summary
 Array emptyLabels
          Set of empty mandatory fields
 Object errorDisplayOptions
          Error summary properties
 Object frm
          Form reference
 Array messages
          Set of error messages
 Array validators
          Set of validators
<static>  Number LIST_BULLET
          Unordered lists must be used to display the summary items
<static>  Number LIST_FLOW
          Summary items must be displayed inside an HTML table
<static>  Number MODE_ALERT
          Errors summary must be reported using an alert box
<static>  Number MODE_DHTML
          Errors summary must be displayed inside some page's node (inline)
 
Constructor Summary
FormValidator (<Object> frm)
            The FormValidator class executes validation routines on fields of a given form.
 
Method Summary
 void add(<String> field, <Function> validator, <Object> args)
           Adds a new validator in the validation chain.
 String buildErrors()
           Builds a string buffer containing the error message(s)
 void clearErrors()
           Clears the target node used to display the error message(s)
 Boolean onAfterValidate(<FormValidator> self)
           This abstract method can be overriden to define extra validation routines.
 void onBeforeValidate(<FormValidator> self)
           Used by the forms API to apply transformations in some fields values (upper, lower, trim, capitalize) before submission
 void run(<Event> e)
           This method runs all the registered validators, collecting the produced error messages.
 void setErrorDisplayOptions(<Number> mode, <Object> target, <Boolean> showAll, <Number> list, <String> header)
           Configures how validation error(s) must be displayed
 void setup()
           Register an onsubmit event listener in the form.
 void showErrors()
           Shows the error message(s) using an alert box (MODE_ALERT) or a given target node (MODE_DHTML)

Field Detail

emptyLabels

Array emptyLabels

errorDisplayOptions

Object errorDisplayOptions

frm

Object frm

messages

Array messages

validators

Array validators

LIST_BULLET

<static> Number LIST_BULLET

LIST_FLOW

<static> Number LIST_FLOW

MODE_ALERT

<static> Number MODE_ALERT

MODE_DHTML

<static> Number MODE_DHTML

Constructor Detail

FormValidator

FormValidator(<Object> frm)

Method Detail

add

void add(<String> field, <Function> validator, <Object> args)

buildErrors

String buildErrors()

clearErrors

void clearErrors()

onAfterValidate

Boolean onAfterValidate(<FormValidator> self)

onBeforeValidate

void onBeforeValidate(<FormValidator> self)

run

void run(<Event> e)

setErrorDisplayOptions

void setErrorDisplayOptions(<Number> mode, <Object> target, <Boolean> showAll, <Number> list, <String> header)

setup

void setup()

showErrors

void showErrors()

PHP2Go Javascript Framework

Copyright © 2002-2006 by Marcos Pont
Documentation generated by JSDoc on Sun Oct 7 19:52:10 2007