[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 135
  • Last Modified:

placing cursor in a form

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
altarEgo
Asked:
altarEgo
  • 2
1 Solution
 
knightEknightCommented:
<BODY onLoad='document.nameOfYourForm.nameOfYourField.focus();'>
0
 
knightEknightCommented:

<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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now