class SAPO.Component.MaskedInput
 TODO: create factory for common usages
 TODO: disable copy paste
 TODO: select cursorPosition IE not perfect yet (makes range selection)

 requires SAPO.Dom.Css
 requires SAPO.Dom.Event
 
Authors:
jose.p.dias AT co.sapo.pt
Version:
0.1
Since:
February 2011
Defined in Component/MaskedInput/0.1/lib.js

Property Summary

Constructor Summary
MaskedInput (String|InputElement container, Object options)

Function Summary
MaskedInput getInstance (String|HTMLElement containerId, String factoryName)
returns a new MaskedInput component based on the factory name passed.
init()
returns the list of supported factory names
Boolean validate()

Property Details

property String version


Constructor Details

constructor MaskedInput

MaskedInput(String|InputElement container, Object options)
Parameters:
container - input element or its id. If value attribute is set, serves as initial content.
options
  • String mask - required
  • [ String regex ] - if not passed is computed from mask (in that case the output has fixed length!)
  • [ String placeholderChar ] - 1 character string to use as a placeholder (defaults to '_')
  • [ Boolean casing ] - if true, always uppercase, if false, always lowercase (defaults to undefined)
  • [ Boolean signedMode ] - if true, - and + ALWAYS replace first character (defaults to false)
  • [ Boolean setCursorAtEnd ] - if true, set the cursor position at the end of the string when the input is focused (defaults to true)

Function Details

function getInstance

MaskedInput getInstance(String|HTMLElement containerId, String factoryName)
returns a new MaskedInput component based on the factory name passed.
Parameters:
containerId
factoryName

function init

init()

function listFactories

Array listFactories()
returns the list of supported factory names

function validate

Boolean validate()