setSyntaxProperty()
Retrieves the value of the specified syntax property for a field.
FieldObject.setSyntaxProperty(
SyntaxProperty)
Arguments
SyntaxProperty—name of a supported field syntax property.
Exceptions
The following exceptions may be thrown:
Description
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 |
setSyntaxProperty
The following example sets the length of
fieldx
to a minimum of 10 and a maximum of 20:
fieldx.setSyntaxProperty("LEN", {min:10, max:20})