Validating User's Input |
![]() ![]() ![]() |
Depending on its type a process field may contain the one or more of the following properties to validate the users' input at the earliest stage. When a ProcessForm is submitted the MoreMotion Face knows from the requiredBlocks property of the ProcessCommand element which ProcessBlocks in the form should be validated and it calls the validate() methods of the ProcessBlock objects. Once they receive the control, the ProcessBlock validate() method calls the validate() methods of the ProcessRecord objects existing in the block and ProcessRecord validate() methods call the validate() methods of the Process Fields existing in the record. This is a standard procedure that is followed upon submission of a ProcessForm. If required the validate() methods of these objects can be called any time without submitting the form.
nonBlank If value of this property is true user is forced to enter a value. isNumber If value of this property is true user is forced to enter a numeric value. The Input field is not validated if there is no value. vvals This property defines the valid values for the field. Each value should be separated with a semi-column. Examples: aaa;bbb;ccc 1;3;5;7 Number ranges can also defined as follows 1:9;21:29;41:49
maxLength This property is applicable only to the EditArea element and defines the maximum number of characters that can be entered in to the field.
valHandler This property defines the name of the Javascript function that provides a custom validation.
valErrorHandler This property defines the name of the validation error handler function. Validation error handlers are called when validation of a process field fails.
If the exception is handled by the handler it should return true to suspend the alerting of the error message to the user.
|