git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4534
7612ce4b-ef26-0410-bec9-
ea0150e637f0
"<!--\n".
" function squirrelmail_loginpage_onload() {\n".
" document.forms[0].js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
- ' document.forms[0].elements[' . (isset($loginname) ? 1 : 0) . "].focus();\n".
+ " var textElements = 0;\n".
+ " for (i = 0; i < document.forms[0].elements.length; i++) {\n".
+ " if (document.forms[0].elements[i].type == \"text\" || document.forms[0].elements[i].type == \"password\") {\n".
+ " textElements++;\n".
+ " if (textElements == " . (isset($loginname) ? 2 : 1) . ") {\n".
+ " document.forms[0].elements[i].focus();\n".
+ " break;\n".
+ " }\n".
+ " }\n".
+ " }\n".
" }\n".
"// -->\n".
"</script>\n";