Solved

placing cursor in a form

Posted on 2002-03-22
2
128 Views
Last Modified: 2010-04-09
Hey, not sure where this should be posted to but
here goes.  I have a page with a login form.  I have
noticed that when you go to some webpages, the developer
has done something that puts the site visitor's cursor
in the first field of the form, saving us the trouble of
having to tab to or click in the form field.  you can
just start typing.

I would like to do this in my form.  Is this a javascript
thing?  HTML?  Can someone tell me how this is done?

tia
0
Comment
Question by:altarEgo
  • 2
2 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 100 total points
ID: 6889498
<BODY onLoad='document.nameOfYourForm.nameOfYourField.focus();'>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6889508

<BODY onLoad='document.myform.mytext1.focus();'>

<FORM name='myform'>
 <INPUT type='text' name='mytext1' value=''><BR>
 <INPUT type='text' name='mytext2' value=''><BR>
 <INPUT type='text' name='mytext3' value=''><BR>
</FORM>
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Input box width 6 28
Html5 Index on a table 7 27
ASP server side get value 15 24
Index on a Table 6 15
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question