Re: onload moving cursor (focus) on first field of form
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: onload moving cursor (focus) on first field of form

From: <binnyva@hotmail.com>
Date: Fri Aug 26 2005 - 13:40:56 CEST

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
Received on Tue Oct 18 03:13:10 2005