Is it possible to stick in a couple lines of code...

GtPrOjEcTX

Lifer
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
 

sash1

Diamond Member
Jul 20, 2001
8,896
1
0
Originally posted by: GtPrOjEcTX
I'm not sure why it made everything italic...

anyways...the code is still accurate..
Because in your code: (de[ I ].type == "password")

that [ I ] is the tag for italics.

[minus the spaces]

~Aunix
 

BennyD

Banned
Sep 1, 2002
2,068
0
0
i find that setting the focus on wepages is unproffessional

and it pisses me off when using tabs, like if i'm typing a post on OT or something and i open a mail account in the background, half my post gets put into the login screen.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: BennyD
i find that setting the focus on wepages is unproffessional

Google... yahoo mail login page... most sites do it, when the site's primary use is entering text right off the bat.

and it pisses me off when using tabs, like if i'm typing a post on OT or something and i open a mail account in the background, half my post gets put into the login screen.

That sounds like a browser problem, focusing keyboard input to a tab that is in the background is idiotic. What browser?
 

ProviaFan

Lifer
Mar 17, 2001
14,993
1
0
Originally posted by: BingBongWongFooey
That sounds like a browser problem, focusing keyboard input to a tab that is in the background is idiotic. What browser?
I've had something similar happen to me in Mozilla (text input going into a text box in a page that was loaded in a tab in the background). Fortunately, it is rather rare.
 

GtPrOjEcTX

Lifer
Jul 3, 2001
10,784
6
81
Originally posted by: AunixM3
Originally posted by: GtPrOjEcTX
I'm not sure why it made everything italic...

anyways...the code is still accurate..
Because in your code: (de[ I ].type == "password")

that [ I ] is the tag for italics.

[minus the spaces]

~Aunix
gotcha...changed variable name to j

so is this doable?