Setting the focus on the first form element available
<script language="javascript" type="text/javascript">
function setFocus(aForm){
if( aForm.elements[0]!=null) {
var i;
var max = aForm.length;
for( i = 0; i < max; i++ ) {
if( aForm.elements[ i ].type != "hidden"
&& !aForm.elements[ i ].disabled
&& !aForm.elements[ i ].readOnly ) {
aForm.elements[ i ].focus();
break;
}
}
}
}
</script>
<body onLoad="setFocus(document.forms[0])"></body>
7411 viewed | Your opinion... | del.icio.us | Digg it | Tjarko @ 23/06/05 9:45 cet



