<?php /// $Id$
+
/// Load up any required Javascript libraries
if (!defined('MOODLE_INTERNAL')) {
<script type="text/javascript" src="<?php echo $CFG->httpswwwroot ?>/lib/overlib/overlib_cssstyle.js"></script>
<script type="text/javascript" src="<?php echo $CFG->httpswwwroot ?>/lib/cookies.js"></script>
<script type="text/javascript" src="<?php echo $CFG->httpswwwroot ?>/lib/ufo.js"></script>
+<script type="text/javascript" src="<?php echo $CFG->httpswwwroot ?>/lib/dropdown.js"></script>
<script type="text/javascript" defer="defer">
<?php // $Id$
+
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
$selectlabel = '<label for="'.$formid.'_jump">'.$selectlabel.'</label>';
}
- $output .= '<div>'.$selectlabel.$button.'<select id="'.$formid.'_jump" name="jump" onchange="'.$targetwindow.'.location=document.getElementById(\''.$formid.'\').jump.options[document.getElementById(\''.$formid.'\').jump.selectedIndex].value;">'."\n";
-
+ //IE and Opera fire the onchange when ever you move into a dropdwown list with the keyboard.
+ //onfocus will call a function inside dropdown.js. It fixes this IE/Opera behavior.
+ if (check_browser_version('MSIE') || check_browser_version('Opera')) {
+ $output .= '<div>'.$selectlabel.$button.'<select id="'.$formid.'_jump" onfocus="initSelect(\''.$formid.'\','.$targetwindow.')" name="jump">'."\n";
+ }
+ //Other browser
+ else {
+ $output .= '<div>'.$selectlabel.$button.'<select id="'.$formid.'_jump" name="jump" onchange="'.$targetwindow.'.location=document.getElementById(\''.$formid.'\').jump.options[document.getElementById(\''.$formid.'\').jump.selectedIndex].value;">'."\n";
+ }
+
if ($nothing != '') {
$output .= " <option value=\"javascript:void(0)\">$nothing</option>\n";
}