Purpose
With setcursor(), you can place the cursor into an inputfield, a table cell, or a position on the list of your choice. There are several possible syntaxes for the setcursor command, which are as follows:
Syntax |
Description |
---|---|
setcursor([row,col]); | To set the cursor into a field based on the coordinates. |
setcursor("F[Name]"); | To set the cursor into a specified inputfield. |
setcursor("cell[tableName, col, row]"); | To set the cursor into a table cell. |
When you use setcursor on a table cell, the column can be identified either by the column number or by the column name as shown in the following examples:
setcursor("cell[Data Entry Area, 5, 10]"); setcursor("cell[Data Entry Area, Subobject, 4]");
Also, the row number can be specified by a variable as shown in the following example:
znum = 1; setcursor("cell[Data Entry Area, 3, &V[z_num]]");
Note: When used with the table command, the column must always be listed before the row as shown in the previous example. Also, the setcursor command will only work for the first row if the table is empty.
Available Options
You can use the following options with the setcursor:
"offset": X - Specifies the position of the cursor to place it from the left margin of the field. |
Options Detail
Note: The offset option can only be used with a field name and doesn't work with field coordinates or on table cells.
Example
Using setcursor() command with Liquid UI fields
To set the cursor into a Liquid UI field, you can use either the field name or its coordinates, as shown below in the script. On execution, the cursor appears on the 'Price' item field, as shown in the following figure:
Script
setcursor("F[Price]"); or setcursor("[1,1]");