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

raeburn raeburn@source.lon-capa.org
Sun, 23 Aug 2009 04:02:47 -0000


raeburn		Sun Aug 23 04:02:47 2009 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - Changes to &set_form_elements() used to set form elements when moving back to earlier pages in a multi-page configuration interface.
    - can set form elements if type hidden
    - a single checkbox can be set to unchecked if required. 
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.233 loncom/interface/lonhtmlcommon.pm:1.234
--- loncom/interface/lonhtmlcommon.pm:1.233	Thu Aug 13 14:54:52 2009
+++ loncom/interface/lonhtmlcommon.pm	Sun Aug 23 04:02:47 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.233 2009/08/13 14:54:52 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.234 2009/08/23 04:02:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1945,7 +1945,7 @@
             $values{$name}[$i] =~ s/([\r\n\f]+)/\\n/g;
             $values{$name}[$i] =~ s/"/\\"/g;
         }
-        if ($$elements{$name} eq 'text') {
+        if (($$elements{$name} eq 'text') || ($$elements{$name} eq 'hidden')) {
             my $numvalues = @{$values{$name}};
             if ($numvalues > 1) {
                 my $valuestring = join('","',@{$values{$name}});
@@ -1980,6 +1980,8 @@
                     $output .= qq|
       if (courseForm.elements['$name'].value == "$value") {
           courseForm.elements['$name'].checked = true;
+      } else {
+          courseForm.elements['$name'].checked = false;
       }|;
                 }
             }