[LON-CAPA-cvs] cvs: loncom /interface lonpickstudent.pm

raeburn raeburn@source.lon-capa.org
Thu, 05 Nov 2009 14:24:01 -0000


raeburn		Thu Nov  5 14:24:01 2009 EDT

  Modified files:              
    /loncom/interface	lonpickstudent.pm 
  Log:
  - Avoid javascript errors in cases where name of form element in form on opener page contains '.' (e.g., courseprefs.pm). 
  
  
Index: loncom/interface/lonpickstudent.pm
diff -u loncom/interface/lonpickstudent.pm:1.27 loncom/interface/lonpickstudent.pm:1.28
--- loncom/interface/lonpickstudent.pm:1.27	Fri Apr 24 05:28:55 2009
+++ loncom/interface/lonpickstudent.pm	Thu Nov  5 14:24:01 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Pick a student from the classlist
 #
-# $Id: lonpickstudent.pm,v 1.27 2009/04/24 05:28:55 raeburn Exp $
+# $Id: lonpickstudent.pm,v 1.28 2009/11/05 14:24:01 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -97,8 +97,8 @@
     $r->print(<<ENDSCRIPT);
 <script type="text/javascript">
 function gochoose(uname,udom) {
-    opener.document.$env{'form.form'}.$env{'form.unameelement'}.value=uname;
-    var slct=opener.document.$env{'form.form'}.$env{'form.udomelement'};
+    opener.document.$env{'form.form'}.elements['$env{'form.unameelement'}'].value=uname;
+    var slct=opener.document.$env{'form.form'}.elements['$env{'form.udomelement'}'];
     var i;
     for (i=0;i<slct.length;i++) {
         if (slct.options[i].value==udom) { slct.selectedIndex=i; }