On a work object form, your application can provide users with interactive formatting and format validation at the keystroke level, or when the user focus leaves the input field.
The first capability is known as client-side input formatting; the second is known as server input formatting.
Don't confuse input formatting, which can change the appearance of the field on a form with validation, which checks whether a user input meets criteria defined through an edit validate rule and may return an error message and cause the display of an mark. Input formatting occurs only after validation, and never returns an error message.
Server input formatting reformats an input field when user focus leaves the field. The new format is computed by the HTML Property rule referenced in the Format field of the Field panel, or that field is blank, the HTML Property rule referenced in the property rule itself.
For example, a user input of 1234567 can be automatically reformatted to contain commas (or periods, depending on locale) as 1,234,567.
This feature depends on AJAX processing, which involves a server interaction and delay. To reduce a possible increase in response time, enable this feature only for fields where reformatting is possible and improves usability.
You can use an HTML Property rule that accepts parameters, but you can't specify the parameters. Input formatting assumes default parameter values.
<pega:include
name="ClientValidation"/>
statement.Optionally, update the property rule to reference the HTML Property rule in the HTML Property field on the Definition tab.
INPUT-FORMAT
.A standard file rule demonstrates this facility for formatting Social Security Numbers in the format NNN-NN-NNNN. To view an example supported by standard rules:
Single Value
property of
type Text
to hold a Social Security Number
(SSN).SSN
for the
Validate field.This capability requires JavaScript skills. If your application requires a new edit validate rule, Java skills are also needed.
This facility uses a JavaScript function on the workstation
to respond to each user keystroke in an input field on a work
object form. The function is linked to the onKeyUp
JavaScript event.
SSN_Formatter()
in the standard text file rule
webwb.input_formatter.js.onKeyUp
JavaScript event, following the example
for SSN. Save the Text File form.Ajax, client-side format validation | |
About Edit Validate rules |