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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a text box have the focus when page is opened

Status
Not open for further replies.

mattbold

Programmer
Oct 5, 2001
45
GB
hi

can anyone please tell me how to make a text box i have on my page have the focus when the page is opened, - so that it will have the cursor in it ready to type straight away ?

- cheers,
matt
 
<SCRIPT Language=VBScript>
document.[formname].[textbox name].focus
</SCRIPT>

Just put that at the end of your page or put it in a function and call the function onLoad and it should work.

HTH

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top