[ 
https://issues.apache.org/jira/browse/WICKET-1085?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Will Hoover updated WICKET-1085:
--------------------------------

    Attachment: inputTextMask.js

Attached is the JS script I wrote to handle the mask on the client. There are 
no libraries needed to use it (it's self contained). All code is original 
except the trivial snippet at the bottom that is public domain that adds an 
escape feature to JavaScript's RegExp.

Example usage (param1= input component, param2=mask, param3=clear the input 
text value when invalid):
<input type="text" onfocus="javascript: InputTextMask.processMaskFocus(this, 
'(999)999-9999', true);" />

/**
 * InputTextMask component script used for mask/regexp operations.
 * Mask Individual Character Usage:
 * 9 - designates only numeric values
 * L - designates only uppercase letter values
 * l - designates only lowercase letter values
 * A - designates only alphanumeric values
 * X - denotes that a custom client script regular expression is specified</li>
 * All other characters are assumed to be "special" characters used to mask
 * the input component
 * Example 1:
 * (999)999-9999 only numeric values can be entered where the the character
 * position value is 9. Parenthesis and dash are non-editable/mask characters.
 * Example 2:
 * 99L-ll-X[^A-C]X only numeric values for the first two characters,
 * uppercase values for the third character, lowercase letters for the
 * fifth/sixth characters, and the last character X[^A-C]X together counts 
 * as the eighth character regular expression that would allow all characters 
 * but "A", "B", and "C". Dashes outside the regular expression are 
 * non-editable/mask characters.
 */

> Input Text Mask
> ---------------
>
>                 Key: WICKET-1085
>                 URL: https://issues.apache.org/jira/browse/WICKET-1085
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>            Reporter: Will Hoover
>            Priority: Trivial
>         Attachments: inputTextMask.js
>
>
> Allow developers to designate a keystroke input pattern for the input text 
> component. The pattern  would be used on the client to control valid 
> keystrokes for the current cursor position within the input text field in 
> relation to the specified pattern.
> For example, a pattern could be designated as "(999)-9999" causing only 
> number values in each position where a "9" appears and using the "(", ")", 
> and "-" as masking characters. When the cursor position reached one of these 
> mask characters the cursor position would advance to the next "9" position. 
> The resulting mask would appear as "(___)___-____" within the input text 
> value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to