Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set focus on a form field not using the body onload method

Status
Not open for further replies.

vego

Programmer
Joined
Jun 26, 2004
Messages
47
Location
US
Hi, just curious to know if there is a way to set the focus in a form field OTHER than using the document.formname.fieldname.focus(); method in the body tag as an onload event?
Thanks.
 
Sure, but it in effect does the same thing, and will not stack with a body onload element.
Code:
<script language=javascript>
window.onload=document.formname.fieldname.focus();
</script>

-kaht

banghead.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top