< html > < head >whatever...< /head > < script language="JavaScript" > function window.onload() { document.forms("Lookup").elements("inputval").focus() } < /script > < body >etc...You can attach code to various events related to controls, although that may not work correctly with all browsers. This allows you, for example, to use the "onblur" event to fire script when the user navigates off of a field, although that might not be what you want if they click somewhere else on the page. But anyway, you can play with this.
< html > < body onload='document.forms(0).elements("entername").focus()' > < form > Name: < input type="textbox" name="entername" tabindex=1 > Address: < input type="textbox" name="enteraddr" tabindex=3 > Phone: < input type="textbox" name="enterphone" tabindex=2 onblur='entername.focus()' > < /form > < /body > < /html >