web/views/basetemplates.py
changeset 29 7d14f1eadded
parent 16 a70ece4d9d1a
child 142 0425ee84cfa6
--- a/web/views/basetemplates.py	Wed Nov 12 16:07:40 2008 +0100
+++ b/web/views/basetemplates.py	Wed Nov 12 16:09:03 2008 +0100
@@ -502,9 +502,7 @@
         self.w(u'</tr>\n')
         self.w(u'</table>\n')
         self.w(u'</form>\n')
-        # XXX doesn't seem to work, rewrite this
-        self.w(u'''<script type="text/javascript">if(document.getElementById("%s").className != "hidden")
-                   {$('login_form').__login.focus()}</script>''' % id)
+        self.req.html_headers.add_onload('jQuery("#__login:visible").focus()')
 
     
 def login_form_url(config, req):