var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
console.log(ctrl.maxLength);
The maxLength
property is used to set the maximum number of characters that can be entered into the control.
The maxLength
property is used for client-side validation only.
To enforce a maximum length on the server side, you must set up the corresponding validation rule within the controls configuration.
var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
// Allow only 120 characters
ctrl.maxLength = 120;
Can get required status.
var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
console.log(ctrl.required);
Sets required status.
var ctrl = ix.api.dom.getControl("<ELEMENT-GUID>");
ctrl.required = true;
Get the current value of the control as JavaScript number object.
var ctrl = ix.api.dom.getControl("<GUID>");
console.log(ctrl.getNumberObject());
// Example:
// Formatted field value (float/currency): "1.000,00"
// Returns: 1000 (number object)
// Example:
// Formatted field value (integer): "1.000"
// Returns: 1000 (number object)
Sets the fields maximum value.
An object of possible options to pass
Whether to run and report the validation (default: true
)
var ctrl = ix.api.dom.getControl("<GUID>");
// Set max value to 100
ctrl.setMaxValue(100);
Sets the fields minimum value.
An object of possible options to pass
Whether to run and report the validation (default: true
)
var ctrl = ix.api.dom.getControl("<GUID>");
// Set min value to 50
ctrl.setMinValue(50);
Creates a local formatted string from a number object or string and writes it as value into a HTML control.
Optional
input: string | numberThe local formatted string
Optional
settings: { Optional
triggerThe conversion uses the fields localization. A string must have the matching format for a propper result!
var ctrl = ix.api.dom.getControl("<GUID>");
ctrl.setValue("10000");
Converts a number or string to a local formatted string.
The given input string/number to convert to the local format
A string with local formatted number or NaN
var ctrl = ix.api.dom.getControl("<GUID>");
ctrl.toLocalFormat("100000");
Gets the maximum length of the control.