About Control object
The Control object allows you to work with the edit controls. Control object is available in the JavaScript OnLoad event of Add/Edit pages.
Before you start working with the edit controls, you need to get those controls.
Use the getControl() method to get the controls by the field name and page ID:
Syntax
var ctrl = Runner.getControl(pageid, fieldname);
Example
var ctrl = Runner.getControl(pageid, 'Make');
controls.ControlManager.getAt(tableName)
To get all the controls of the table, you need to pass only the table name as the argument:
Syntax
var ctrlArr = Runner.controls.ControlManager.getAt(tableName);
Example
// Get all the controls for the 'Cars' table
var recCtrlsArr = Runner.controls.ControlManager.getAt('Cars');
// loop through all controls on the page making them all required
for(var i=0;i<recCtrlsArr.length;i++)
{
var ctrl = recCtrlsArr[i];
ctrl.addValidation("IsRequired");
}
Methods
Method |
Description |
Adds the class to the control with a value. |
|
Adds the style to the control. |
|
Adds validation to the control. |
|
Sets "" as the control value. If the control was not previously validated, removes the message that it was not validated. |
|
Deletes events. |
|
Returns a jQuery object - the element (input, textarea, select, etc.) that displays the value of the selected field. |
|
Reads the control value. |
|
Hides the control. |
|
Gets the control status after the last validation. |
|
Gets the control readonly status. |
|
Makes control readonly. |
|
Makes control writable. |
|
Adds an event to the control and transfers an array of arguments to the handler. |
|
Removes the from the control. |
|
Removes validation from the control. |
|
Sets the control value to the original one. |
|
Makes the control "disabled". |
|
Makes the control "enabled". |
|
Sets focus to the control. |
|
Sets the control value. |
|
Shows the control. |
|
Validates the control. |
|
Validates the control value for some validation type. |
Event name |
Description |
blur |
An element loses focus. |
change |
The user changes the content of a field. |
click |
Mouse clicks an object. |
dblclick |
Mouse double-clicks an object. |
focus |
An element gets focus. |
keydown |
A keyboard key is pressed. |
keypress |
A keyboard key is pressed or held down. |
keyup |
A keyboard key is released. |
mousedown |
A mouse button is pressed. |
mousemove |
The mouse is moved. |
mouseout |
The mouse is moved off the element. |
mouseover |
The mouse is moved over an element. |
mouseup |
A mouse button is released. |
resize |
A window or frame is resized. |
select |
Text is selected. |
Control object examples:
•Ask for confirmation before saving a record
•Change font in "edit" controls
•Change width of edit box with AJAX popup
•Change width of text field on Quick Search panel
•How to calculate values (totals) on the fly
•How to control Inline Add/Edit functionality from script
•How to hide 'Edit selected'/'Delete selected' buttons
•Show dropdown list of US states if US was selected in country list
See also:
•JavaScript API: Control object > addValidation()