Setting focus to a default control allows the user to begin typing
without having to use the mouse. In the following example, a listbox named
"lb_cat" exists on form "frm_tttnew". The goal is to set focus to this
control after the form is loaded. Here's how the end of the HTML file
would look.
<script language="javascript">
<!--
//--------------------------------------------------------------------------
document.frm_tttnew2.lb_cat.focus()
//--------------------------------------------------------------------------
// -->
</script>
</body>
</html>
Note that this code is after the form definition, and before the
last HTML tag.
|
|