Set focus on Quick Search on a Grid app

Hi there,

Does anyone know how to go about automatically set focus on the Quick Search box in a toolbar on a grid application. Any help much appreciated.

Regards
Junior Brandt

Grid -> Settings -> Start by Search = Yes

Thanks Richard, however, this only starts the app by showing the search form, it does not simply direct the focus to the Quick Search box in the app toolbar - which is what I (more precisely, the customer) wants…

Any other ideas welcome

[QUOTE=symanix;19295]Thanks Richard, however, this only starts the app by showing the search form, it does not simply direct the focus to the Quick Search box in the app toolbar - which is what I (more precisely, the customer) wants…

Any other ideas welcome[/QUOTE]

I’m not a javascript guru, but if you look into the html you can find the fieldname of the search field. Then apply a piece of javascript to set the focus?

I was thinking along the same lines, but then I cannot run a java function using the onScriptInit event… If you can tell me how to get the java executed everytime the grid app is loaded, i.e an ‘onLoad’ event, then I could probably get it to work… thanks for the comment :slight_smile:

Just a thought (not tested).
The page will need to get loaded and I dont see an onload event anywhere in the generated code. Hence you should be able to insert some onload code, so I guess that you could look for <body class= in the generated code and add an onload
there by hand…

have you tried to put an echo statement in the onscriptinit with the javascript procedure?

Something like:

echo " <script type='text/javascript>";
echo " document.getElementById(‘fieldId’).focus()";
echo “</script>”;

or

document.yourform.fieldname.focus();