- Jul 3, 2001
- 10,784
- 6
- 81
on the subscriber login page and the forum login page to automatically put the focus in the username field? it'll take 2 seconds and its more convenient for the thousands of AT users.
ex. code:
stick this in the head...
<script language="JavaScript">
function initFocus() {
var de = document.forms["CFForm_1"].elements;
for (var j=0; j<de.length; j++) {
if (((de[j].type == "text") || (de[j].type == "password"))
&& (de[j].value == "")) {
de[j].focus();
break;
}
}
}
</script>
and in the body tag... put onload="initFocus();"
this script looks at the fields in form "CFForm_1", and puts the focus in the first empty field
ex. code:
stick this in the head...
<script language="JavaScript">
function initFocus() {
var de = document.forms["CFForm_1"].elements;
for (var j=0; j<de.length; j++) {
if (((de[j].type == "text") || (de[j].type == "password"))
&& (de[j].value == "")) {
de[j].focus();
break;
}
}
}
</script>
and in the body tag... put onload="initFocus();"
this script looks at the fields in form "CFForm_1", and puts the focus in the first empty field
