]> git.mjollnir.org Git - moodle.git/commitdiff
weblib: fix bug with disabled pop_form()s
authortjhunt <tjhunt>
Tue, 7 Apr 2009 07:40:40 +0000 (07:40 +0000)
committertjhunt <tjhunt>
Tue, 7 Apr 2009 07:40:40 +0000 (07:40 +0000)
lib/weblib.php

index 96fcc6ba8a9bc58659551b18f07da13c08802628..eb6adeaef64393a2fbf6a75604dfa233c98a1beb 100644 (file)
@@ -959,7 +959,6 @@ function print_textfield ($name, $value, $alt = '',$size=50,$maxlength=0, $retur
  */
 function popup_form($baseurl, $options, $formid, $selected='', $nothing='choose', $help='', $helptext='', $return=false,
     $targetwindow='self', $selectlabel='', $optionsextra=NULL, $submitvalue='', $disabled=false, $showbutton=false) {
-
     global $CFG, $SESSION;
     static $go, $choose;   /// Locally cached, in case there's lots on a page
 
@@ -980,7 +979,7 @@ function popup_form($baseurl, $options, $formid, $selected='', $nothing='choose'
         $nothing = $choose.'...';
     }
     if ($disabled) {
-        $disabled = 'disabled="disabled"';
+        $disabled = ' disabled="disabled"';
     } else {
         $disabled = '';
     }
@@ -1019,7 +1018,7 @@ function popup_form($baseurl, $options, $formid, $selected='', $nothing='choose'
           $formid.'\').jump.selectedIndex].value;"';
     }
 
-    $output .= '<div style="white-space:nowrap">'.$selectlabel.$button.'<select id="'.$formid.'_jump" name="jump"'.$javascript.'>'."\n";
+    $output .= '<div style="white-space:nowrap">'.$selectlabel.$button.'<select id="'.$formid.'_jump" name="jump"'.$javascript.$disabled.'>'."\n";
 
     if ($nothing != '') {
         $selectlabeloption = '';