Focal Point
Setting focus on a specific field on a screen

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1401080582

May 22, 2008, 09:49 AM
seadog
Setting focus on a specific field on a screen
I am selecting a button from frm1 and executing a function to add records to a db. I want to put the cursor back on the first text box on frm1 upon returning from the called function.


WebFOCUS 7.6.4
Windows
May 22, 2008, 10:06 AM
GamP
You can do that by setting the tab order of the fields in the form so that this text field is the first in the lsit.
An alternative method would be to include a small javascript code that does that.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
May 22, 2008, 03:59 PM
seadog
The tab order process does not accomplish the task. I have it set that way now.


WebFOCUS 7.6.4
Windows
May 23, 2008, 10:09 AM
smiths
Have you tried the Javascript function call:

document.frm1.firstFieldName.focus()

Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
May 26, 2008, 02:14 AM
<Shyam L>
In the window_onload() function use
document.formname.fieldname.focus() as Sean said
or in case you are not using Form tag then use
fieldname.focus(). Your tab order will also work once you do this.
May 27, 2008, 10:14 AM
seadog
Shyam,

Where is the window_onload function? I do not find it in the Events tab for any of the forms I have created.

I tried your command on the "open" event function and Maintain returned an error code.
My form name is frm_update with a field name of acronym_name_Edit.


WebFOCUS 7.6.4
Windows
May 27, 2008, 03:09 PM
seadog
Maintain Wizard resolved the issue with the following command:

Winform Set frmname.field_name_Edit.Focus to Here


WebFOCUS 7.6.4
Windows