Predefined patterns
You can quickly create and
modify display, edit, and validation patterns to format data input
values (user input or bound data) by selecting predefined patterns from
the Select Type list on the Display tab in the Patterns dialog box
(Object palette > Patterns). For example, the Postal Code (United
Kingdom) option provides the pattern A9A 9A9|AA9A 9A9, such that
an input value of KB1C3R2 produces a formatted value of KB1C 3R2.
Custom patterns
The following table shows some custom patterns
that you can define in the Pattern box for formatting input values
(user input or bound data) using a display pattern.
Custom pattern
|
Input value
|
Formatted value
|
'+1 ('999') '999-9999
|
6135551212
|
+1 (613) 555-1212
|
999.999.9999
|
6135551212
|
613.555.1212
|
In the next example, a serial number requires
input like this: three alphabetic characters, followed by four digits,
followed by a single character of any type. A suitable text pattern
would be as follows:
AAA-9999-X
The
following table below shows the results of converting some example
input values (user input or bound data) into raw values using an
edit pattern or data pattern.
Custom pattern
|
Input value
|
Raw value
|
AAA-9999-X
|
ABC-1234-5
ABC-1234-D
123-4567-8
|
ABC12345
ABC1234D
""
|
In the last example, because the input
value 123-4567-8 does not match the pattern, the resulting raw value
is an empty string.
|
|
|