SDO How to define masking patter for fields - kwantu/platformconfiguration GitHub Wiki
<elField id="documentName">
<displays>
<display show="true" mode="edit" widget="mask" maskFormat="(999)-000-0000" hidePromptOnLeave="true">
<label show="true">
<i18n xml:lang="en">Document name</i18n>
<i18n xml:lang="pt">Document name</i18n>
</label>
<style width="90%"/>
</display>
<display show="true" mode="readonly" widget="label">
<label show="true">
<i18n xml:lang="en">Document name</i18n>
<i18n xml:lang="pt">Document name</i18n>
</label>
<style width="90%"/>
</display>
</displays>
<fieldData dataType="string"/>
<validations>
<validation seq="1">
<simple type="required" dataType="boolean" value="true"/>
<errorMessage>
<i18n xml:lang="en">Please enter Document name</i18n>
<i18n xml:lang="pt">Please enter Document name</i18n>
</errorMessage>
</validation>
</validations>
</elField>
The property can be a string composed of one or more of the masking elements as shown in the following table.
Masking Element | Description |
---|---|
0 | Digit, required. This element will accept any single digit between 0 and 9. |
9 | Digit or space, optional. |
# | Digit or space, optional. Plus (+) and minus (-) signs are allowed. |
L | Letter, required. Restricts input to the ASCII letters a-z and A-Z. Valid letters are members of the following categories in UnicodeCategory: UppercaseLetter, LowercaseLetter, TitlecaseLetter, ModifierLetter, and OtherLetter. |
? | Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions. |
& | Character, required. |
C | Character, optional. Any non-control character. |
A | Alphanumeric, optional. |
a | Alphanumeric, optional. |
. | Decimal placeholder. The actual display character used will be the decimal placeholder appropriate to the culture option. |
, | Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the culture option. |
: | Time separator. The actual display character used will be the time placeholder appropriate to the culture option. |
/ | Date separator. The actual display character used will be the date placeholder appropriate to the culture option. |
$ | Currency symbol. The actual character displayed will be the currency symbol appropriate to the culture option. |
< | Shift down. Converts all characters that follow to lowercase. |
> | Shift up. Converts all characters that follow to uppercase. |
| | Disable a previous shift up or shift down. |
H | All SBCS characters. |
K | SBCS Katakana. |
9 | DBCS Digit |
K | DBCS Katakana |
J | Hiragana |
Z | All DBCS characters. |
N | All SBCS big Katakana. |
N | Matches DBCS big Katakana. |
G | Matches DBCS big Hiragana. |
\\ | Escape. Escapes a mask character, turning it into a literal. The escape sequence for a backslash is: \\\\ |
All other characters, Literals. | All non-mask elements appear as themselves within wijinputmask. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user. |
The following table shows example masks.
Example Mask | Description |
---|---|
00/00/0000 | A date (day, numeric month, year) in international date format. The "/" character is a logical date separator, and will appear to the user as the date separator appropriate to the application's current culture. |
00->L<LL-0000 | A date (day, month abbreviation, and year) in United States format in which the three-letter month abbreviation is displayed with an initial uppercase letter followed by two lowercase letters. |
(999)-000-0000 | United States phone number, area code optional. If users do not want to enter the optional characters, they can either enter spaces or place the mouse pointer directly at the position in the mask represented by the first 0. For example: $(".selector").wijinputmask({ maskFormat: "(999)-000-0000 " }); |
$999,999.00 | A currency value in the range of 0 to 999999. The currency, thousandth, and decimal characters will be replaced at run time with their culture-specific equivalents. |
The maskFormat value can also take the form of a regular expression. For example:
\D{3}-\D{4} yields a Zip Code like this: (012-3456)
℡ \D{2,4}-\D{2,4}-\D{4}/ yields a phone number like: (℡ 012-345-6789)
\D{2,4}-\D{2,4}-\D{4} yields a phone number like: ( 012-345-6789)
Key Word | Description |
---|---|
\A | Matches any upper case alphabet [A-Z]. |
\a | Matches any lower case alphabet [a-z]. |
\D | Matches any decimal digit. Same as [0-9]. |
\W | Matches any word character. It is same as [a-zA-Z_0-9]. |
\K | Matches SBCS Katakana. |
\H | Matches all SBCS characters. |
\A | Matches any upper case DBCS alphabet [A-Z]. |
\a | Matches any lower case DBCS alphabet [a-z]. |
\D | Matches any DBCS decimal digit. Same as [0-9]. |
\W | Matches any DBCS word character. It is same as [a-zA-Z_0-9]. |
\K | DBCS Katakana |
\J | Hiragana |
\Z | All DBCS characters. |
\N | Matches all SBCS big Katakana. |
\N | Matches DBCS big Katakana. |
\G | Matches DBCS big Hiragana. |
\T | Matches surrogate character. |
[] | Used to define a combination character subset. |
[^] | Used to express an exclude subset. |
- | Used to define a contiguous character range. |
{} | Specifies a pattern. |
* | The short expression of {0,}. |
+ | The short expression of {1,}. |
? | The short expression of {0,1}. |