Development tools : XUI editor : Editing an XUI page : Editing the properties of the XUI widgets : Defining cross-field validation in a form : Cross-field validation process in client side and server side
  
Cross-field validation process in client side and server side
The validation can be executed from both client side and server side. This page will introduce the validation process and rules in both client-side and server-side.
Client-side behavior
In client-side, when any field in the form is changed (lost focus), the form will directly invoke the xValidation rules developers have defined and selectively pop up the hint message. Until all the cross-field validations are valid, submit buttons in the form will be disabled and no data can be submitted to the server.
When a cross-field validation rule is not valid, and there is no single-field validation failed, the hint message of the invalid cross-field validation rule will be shown. If a form has multiple cross-field validation rules, and more than one rules are not valid, only one hint message of invalid rule will be selected and shown on the form. The message of invalid rules is selected according to:
If the last changed field is belonged to a cross-field validation rule, and all other fields in the rule have their values.
If no rule can be found in 1, then choose the first invalid rule according to definition sequence.
This graphic is described in the surrounding text.
Server-side behavior
If the client-side validation are accidently shut down or hacked by purpose, the form is submitted to the server. Then the server-side validation will be invoked.
Among all the xValidation rules you have defined, headless xValidation will be generated into a file under the definitions.operation folder.
In the server side, only the headless xValidation rules will be executed.
Headless xValidation has headless conditions, including:
Widget function: no headless widget functions
Widget property: those mapped to a context dataName.
 
Widget
headless property
TextBox
value
Combo
value
Radio
value
Checkbox
isChecked
SelectList
value
MultiSelect
value
CheckedMultiselect
value
EnhancedMultiselect
value
RichText
value
TextArea
value
Tree
value
HiddenField
value
Expression: those in which both left and right components are headless
Global function: all functions available at the server side, as defined in their configuration, are headless
Constant: All constants
When a cross-field validation rule is not valid in the server side, an error message page will be shown.
This graphic is described in the surrounding text.
Go up to
Defining cross-field validation in a form