PHP2Go Javascript Framework

Class Mask

Object
   |
   +--Mask

class Mask

Defined in inputmask.js


Field Summary
 Array fields
          Set of mask fields and literals
 
Constructor Summary
Mask ()
            A mask is a set of definitions to restrict the contents and format required in a form field.
 
Method Summary
 Boolean accept(<String> chr, <Number> caretPos, <Number> selSize, <Number> maxLen)
           Test if a char must be accepted by the mask, given the current caret position and the current field's selection size
 void addField(<String> chars, <Number> min, <Number> max)
           Adds a new field in the mask.
 void addLiteral(<String> c, <Boolean> opt)
           Adds a new literal in the mask.
 void apply(<Object> fld)
           Apply the mask by filtering (when the mask is a simple filter) or formatting (when the mask contains multiple fields and literals)
 <private>  void filter(<Object> field)
           Filters the field value removing chars that don't respect the mask regular expression
 <private>  void format(<Object> field)
           Iterates through all the field chars, validating them against the mask format.
 Number getCaretPosition(<String> oldVal, <String> newVal, <Number> caret, <Number> key)
           This method can be overriden to add caret position routines.
 Number getMaxLength()
           Calculate the maxlength of the mask
 Number getMaxPosition(<Number> idx, <Number> max)
           Return the highest available position inside a field, based on its index.
 Boolean isComplete()
           Verifies if the mask is complete
 Boolean isOnlyFilter()
           Verify if the mask is a simple regexp filter, without multiple fields or literals
 void loadExpression(<String> expr)
           Transforms a given expression into fields and literals.
 String onAfterChange(<String> val)
           Handler function called from inside Mask.format().
 String onBeforeChange(<String> val)
           Handler function called from inside Mask.format().
 void onBlur(<Object> fld)
           This method can be overriden to apply transformations or validations in the field's value when the blur event occurs
 Boolean onKeyDown(<Object> fld, <Integer> caret, <Integer> key)
           Handler function called from inside InputMask.keyDownHandler().
 String serialize()
           Serialize the mask
<static> Mask fromExpression(<String> expr, d)
           Build a new instance of the Mask class based on a given expression.
<static> Mask fromMaskName(<String> name)
           Return a Mask object based on one of the mask names available to the PHP2Go form API: DIGIT, INTEGER, FLOAT, CURRENCY, DATE, ...

Field Detail

fields

Array fields

Constructor Detail

Mask

Mask()

Method Detail

accept

Boolean accept(<String> chr, <Number> caretPos, <Number> selSize, <Number> maxLen)

addField

void addField(<String> chars, <Number> min, <Number> max)

addLiteral

void addLiteral(<String> c, <Boolean> opt)

apply

void apply(<Object> fld)

filter

 <private> void filter(<Object> field)

format

 <private> void format(<Object> field)

getCaretPosition

Number getCaretPosition(<String> oldVal, <String> newVal, <Number> caret, <Number> key)

getMaxLength

Number getMaxLength()

getMaxPosition

Number getMaxPosition(<Number> idx, <Number> max)

isComplete

Boolean isComplete()

isOnlyFilter

Boolean isOnlyFilter()

loadExpression

void loadExpression(<String> expr)

onAfterChange

String onAfterChange(<String> val)

onBeforeChange

String onBeforeChange(<String> val)

onBlur

void onBlur(<Object> fld)

onKeyDown

Boolean onKeyDown(<Object> fld, <Integer> caret, <Integer> key)

serialize

String serialize()

fromExpression

<static> Mask fromExpression(<String> expr, d)

fromMaskName

<static> Mask fromMaskName(<String> name)

PHP2Go Javascript Framework

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