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

Default Textbox Field

Status
Not open for further replies.

tbohon

Programmer
Apr 20, 2000
293
US
Is there a way in HTML to specify that a certain field is the default and to give it focus when the page loads?

I have a login screen and would like the user ID field to have focus with the cursor sitting there when the page loads --- but I'm unable to figure out how to do it (or even if it can be done).

Thanks in advance.

Tom

"My mind is like a steel whatchamacallit ...
 
You mean like this at the bottom of the page?
Code:
<script>
document.forms['formnamehere'].elements['textboxnamehere'].focus();
</script>

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top