setSyntaxProperties()
Sets multiple syntax properties for a field.
FieldObject.
setSyntaxProperties(
SyntaxProperties)
Arguments
SyntaxProperties—a JavaScript object with property name-value pairs.
Exceptions
The following exceptions may be thrown:
Description
SyntaxProperties may specify syntax properties that the field already has, in which case the existing property value is overwritten with the new value, or properties that the field does not yet have, in which case the field gets that additional property.
The initial values of a DSP field's widget properties can be set in the Define (Component) Field Properties dialog, or they can be set in Proc using $fieldsyntax. The can be retrieved in JavaScript using the getDeclarativeSyntax function.
Once the DSP is loaded, the values of these properties can be dynamically changed in the browser using the setSyntaxProperty and setSyntaxProperties API functions.
You can use the clearSyntaxProperties function to reset the field's syntax properties to their initial values.
Property | JavaScript Data Type | Values | Description/Remarks |
---|---|---|---|
NED
|
Unsupported. Use property html:readOnly instead |
— | No edit allowed in this field. |
DIM
|
Unsupported. Use property html:disabled instead |
— | Dim field. No edit and no prompt. |
ENT
|
string | Uniface entry format string | Syntax for data entry. For example,
"&*" (zero or more [a-zA-Z]). For more information, see Field Syntax Codes. |
LEN
|
object | { min: Number, max: Number }
|
Length of field or subfield. |
ASC
|
boolean | ASCII, in Unicode range 00-7F | |
BRM
|
boolean | Check that brackets match. | |
DIG
|
boolean | Digits only (0-9) | |
DLS
|
boolean | Delete leading spaces. | |
DLZ
|
boolean | Delete leading zeros. | |
LOW
|
boolean | All lowercase | |
MAN
|
boolean | Mandatory field (minimum length of one). | |
NUM
|
boolean | Numbers only (0-9, . + -) | |
RCS
|
boolean | Replace contiguous spaces with one space. | |
UPC
|
boolean | All uppercase |
setSyntaxProperties
The following example specifies that
fieldx
can contain only 3 to 5 digits:
fieldx.setSyntaxProperties ( {"DIG" : true, "LEN" : { "min" : 3, "max" : 5 } } )