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

raeburn raeburn@source.lon-capa.org
Sun, 14 Nov 2010 18:53:51 -0000


raeburn		Sun Nov 14 18:53:51 2010 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Eliminate Javascript warnings where the current context does not allow 
    more than one authentication choice when uploading a file of users.  
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.985 loncom/interface/loncommon.pm:1.986
--- loncom/interface/loncommon.pm:1.985	Fri Oct 29 20:41:43 2010
+++ loncom/interface/loncommon.pm	Sun Nov 14 18:53:51 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.985 2010/10/29 20:41:43 raeburn Exp $
+# $Id: loncommon.pm,v 1.986 2010/11/14 18:53:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2274,12 +2274,16 @@
 }
 
 function set_auth_radio_buttons(newvalue,currentform) {
+    var numauthchoices = currentform.login.length;
+    if (typeof numauthchoices  == "undefined") {
+        return;
+    } 
     var i=0;
-    while (i < currentform.login.length) {
+    while (i < numauthchoices) {
         if (currentform.login[i].value == newvalue) { break; }
         i++;
     }
-    if (i == currentform.login.length) {
+    if (i == numauthchoices) {
         return;
     }
     current.radiovalue = newvalue;