Index: openacs-4/packages/dotlrn/www/dotlrn-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-master.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/dotlrn/www/dotlrn-master.tcl 22 Oct 2003 11:29:45 -0000 1.26 +++ openacs-4/packages/dotlrn/www/dotlrn-master.tcl 24 Oct 2003 13:02:32 -0000 1.27 @@ -503,10 +503,25 @@ if { ![template::util::is_nil focus] } { # Handle elements wohse name contains a dot - regexp {^([^.]*)\.(.*)$} $focus match form_name element_name - - template::multirow append \ - attribute onload "javascript:document.forms\['${form_name}'\].elements\['${element_name}'\].focus()" + if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { + + # Add safety code to test that the element exists ' + set header_stuff "$header_stuff + + " + + template::multirow append \ + attribute onload "javascript:acs_focus('${form_name}', '${element_name}')" + } } # Developer-support support