The setCursorFocus snippet in the JSP drawer of the Snippets view is a JavaScriptâ„¢ function that sets the cursor focus to a specified form field on a Web page. It must be placed within a <script> tag in a JSP page. To insert and configure this snippet, follow these directions:
function setFocus() { document.getElementById('form1').elements[n].select(); document.getElementById('form1').elements[n].focus(); }
Related tasks
Inserting code snippets into EGL and JSP files