|
Sydney | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Widget | +--Text | +--ValidatingText
Defined in form_widgets.js
Fields inherited from class Text |
|
Fields inherited from class Widget |
html, id, parent, layoutData, eventTable
|
Constructor Summary | |
ValidatingText
(<Function> validKeyRangeFunc, <Function> validValueFunc, <Function> textTransformerFunc)
The ValidatingText object inherits Text and provides a means for executing validation functions on a text box. |
Method Summary | |
function
|
_handleChange(e)
|
function
|
_handleKeyPress(e)
|
boolean
|
isAlpha(<int> keyCode)
Returns true if the keyCode is alphabetic. |
boolean
|
isAlphaNum(<int> keyCode)
Returns true if the keyCode is alphanumeric. |
boolean
|
isDigit(<int> keyCode)
Returns true if the keyCode is a digit. |
boolean
|
isLower(<int> keyCode)
Returns true if the keyCode is lower case. |
boolean
|
isSpace(<int> keyCode)
Returns true if the keyCode is a space character which includes tabs, line-feeds, etc. |
boolean
|
isUpper(<int> keyCode)
Returns true if the keyCode is upper case. |
void
|
setTextTransformer(<Function> func)
Set the text transformation function for this validating text widget. |
Methods inherited from class Text |
getMaxLength, getText, setMaxLength, setText
|
Constructor Detail |
function ValidatingText(<Function> validKeyRangeFunc, <Function> validValueFunc, <Function> textTransformerFunc)
validKeyRangeFunc
- (Optional) - a function taking a single integer argument representing the entered key code (Unicode) and returning true
if the character is allowed or false otherwise. If this argument is null
all charactors will be allowed. For example: function(keyCode) { return (keyCode >= 65 && keyCode <= 90); }
validValueFunc
- (Optional) - a function taking a single string argument representing the current text value. The function should return true
if the text is valid or false
otherwise. For example: function(text) { return (text == "TEST"); }
textTransformerFunc
- (Optional) - this function is called on a change event to transform the text in the text box. It is also called when the validation function fails in order to attempt to resolve the failed validation. It takes a single string as it's argument and returns a resultant string. For example: function(text) { return ((text=="123A") ? "123" : text); }
Method Detail |
function _handleChange(e)
function _handleKeyPress(e)
boolean isAlpha(<int> keyCode)
keyCode
- An ascii integer.
boolean isAlphaNum(<int> keyCode)
keyCode
- An ascii integer.
boolean isDigit(<int> keyCode)
keyCode
- An ascii integer.
boolean isLower(<int> keyCode)
keyCode
- An ascii integer.
boolean isSpace(<int> keyCode)
keyCode
- An ascii integer.
boolean isUpper(<int> keyCode)
keyCode
- An ascii integer.
void setTextTransformer(<Function> func)
func
- The text transformation function.
|
Sydney | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |