Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > onload moving cursor (focus) on first field of form

Reply
Thread Tools

onload moving cursor (focus) on first field of form

 
 
Zvonko
Guest
Posts: n/a
 
      08-26-2005
Hi!

As mentioned in title. How to do it?

Thanks
Zvonko
 
Reply With Quote
 
 
 
 
binnyva@hotmail.com
Guest
Posts: n/a
 
      08-26-2005
The easier version...

<body onload="document.forms[0].elements[0].focus();">

Or the better version...

<script language="javascript" type="text/javascript">
function loadFocus() {
document.forms[0].elements[0].focus();
}
window.onload = loadFocus;
</script>

Both will give the focus to the first field in the first form.

Binny V A
http://binnyva.blogspot.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to tell if cursor is sqlite.Cursor or psycopg2.Cursor dmaziuk Python 3 01-25-2011 04:52 AM
Moving the cursor (insertion point) in an input (text) field Klaus Brune Javascript 4 05-29-2008 08:42 PM
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted ASP .Net 0 01-06-2008 04:45 AM
base.OnLoad called, OnLoad not executed Fabio R. ASP .Net 0 03-25-2005 01:21 PM
focus on first text form field w/o using onload reneecccwest Javascript 1 02-24-2004 10:03 PM



Advertisments