Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > Control object > Methods

JavaScript API: Control object > setFocus()

Scroll Prev Next More

 

Sets focus to the control and, depending on the triggerEvent argument, raises/does not raise "focus" event.

Syntax

ctrl.setFocus(triggerEvent);

Arguments

triggerEvent (optional)

if true, the app runs the "focus" event, previously added to the control using the on function. If false or not specified, the app does not run the event.

Return value

No return value.

Example

Set focus to the control using the JavaScript OnLoad event:

 

var ctrl = Runner.getControl(pageid, 'Make');
ctrl.setFocus();

See also:

JavaScript API: Control object > getControl()

JavaScript API: Control object > on()

JavaScript API: Control object > show()

Events: JavaScript OnLoad

JavaScript API: Control object

JavaScript API

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software