Syntax Checking in Web Applications

Uniface always validates data before storing it to ensure that it conforms with field syntax definitions and other validation rules. However, it is also possible to have the browser check some field syntax definitions so that the user gets immediate feedback on possible data entry errors.

There are several ways that browser-side syntax checking can be enabled, and syntax errors handled and displayed. The different methods also influence the type of syntax definitions that can be checked.

  • For dynamic server pages, syntax checking is enabled by setting the property Syntax Check on Browser for a field.

    Syntax checking is implemented by JavaScript, but the way errors are handled and displayed depends on the widget implementation (HTML5 controls or JavaScript widgets), and your own programming decisions. For more information, see Syntax Checking in Dynamic Server Pages .

  • For static server pages, syntax checking is enabled for all fields in the page by adding the <x-option fieldcheck="true"> tag in the layout. A number of <x-subst fieldcheck> tags must also be present. For more information, see Syntax Checking in Static Server Pages.

As browsers have evolved, they have been able to provide some simple forms of automatic syntax checking and correction. For example, most browsers can automatically convert the case of a field if upper or lowercase is required.

Differences Between Web and Desktop Applications

The following table illustrates the differences between syntax checking in web and desktop environments:

Differences between Web and Desktop Syntax Checking
Aspect Web Desktop
Display format allowed. Common display formats only. All combinations allowed.
Input length checking. LEN() is not checked in combination with Date, Time, or Datetime data types. Allowed.
Month name checking. Must contain a minimum of three characters. Full month, abbreviated month, and alternative month checking, where the end user can alter months via language setup.
Displaying DateTime fields. Only the syntax is checked. The displayed values do not change. The input value is displayed using the display model.
Japanese dates. Not allowed. Allowed.

Supported Field Syntax Checks

Syntax settings that can be checked in the browser are shown in the following table:

Field Syntax Settings for the Web
Code Description When checked Action Remarks
ENT Entry format Leaving field Message  
LOW Lowercase Leaving field Convert to lowercase In the web environment, alphabetic characters are not converted to lowercase until you leave the field.
UPC Uppercase Leaving field Convert to uppercase In the web environment, alphabetic characters are not converted to uppercase until you leave the field.
NED No edit Changing field Message An input field (edit box) is not displayed as an input field, but as a fixed text field. There is no distinction between a NED edit box field and a label field.
DIM Disable Changing field Message An input field (edit box) is not displayed as an input field, but as a fixed-text field with the strike attribute.
HID Hide field (no display, no edit, and no prompt) Changing field Message If the server page has a record layout, associated labels will also be hidden.
MAN Mandatory Leaving field Message  
LEN Min/max length Leaving field Message  
BRM Match brackets Leaving field Message  
DIG Digits only Leaving field Message  
NUM Numbers only Leaving field Message  
ASC ASCII only Leaving field Message  
MUL ISO Latin-1 only Leaving field Message  
RCS Replace contiguous spaces Leaving field Replace contiguous spaces with single space  
DLS Delete leading spaces Leaving field Remove leading spaces  
DLZ Delete leading zeros Leaving field Remove leading zeros In server pages, only the displayed value is changed, because there is no internal value.

In other components, the internal value changes but the displayed value may not be.

Related Topics