]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8062 Remove name attribute from <form> and related javascript code cleanup (teste...
authorskodak <skodak>
Sat, 6 Jan 2007 19:22:58 +0000 (19:22 +0000)
committerskodak <skodak>
Sat, 6 Jan 2007 19:22:58 +0000 (19:22 +0000)
38 files changed:
files/index.php
install.php
lib/editor/htmlarea/coursefiles.php
lib/editor/htmlarea/popups/createanchor.php
lib/editor/htmlarea/popups/insert_image.php
lib/editor/htmlarea/popups/link.php
lib/javascript-static.js
mod/assignment/lib.php
mod/assignment/mod.html
mod/exercise/assessments.php
mod/exercise/locallib.php
mod/exercise/submissions.php
mod/exercise/view.php
mod/forum/search.php
mod/hotpot/mod.html
mod/lams/mod.html
mod/lesson/action/continue.html
mod/lesson/view.php
mod/quiz/config.html
mod/resource/config.html
mod/resource/type/common.html
mod/resource/type/file/localfile.php
mod/resource/type/file/localpath.php
mod/resource/type/repository/hive/openhive.php
mod/scorm/mod.html
mod/survey/view.php
mod/workshop/assessments.php
mod/workshop/locallib.php
mod/workshop/submissions.php
question/editlib.php
question/import.php
question/type/calculated/editquestion.html
question/type/calculated/questiontype.php
question/type/datasetdependent/datasetitems.php
question/type/datasetdependent/questiondatasets.html
question/type/editquestionstart.html
question/type/random/editquestion.html
question/type/rqp/editquestion.html

index 89e7d354bb8de3282a0df89099dade902fcbcc10..102316609b2978ce48c2c76f92ae39df1e86fd36 100644 (file)
@@ -815,7 +815,7 @@ function displaydir ($wdir) {
                    "zip" => "$strcreateziparchive"
                );
     if (!empty($count)) {
-        choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
+        choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:getElementById('dirform').submit()");
     }
     echo "</td></tr></table>";
     echo "</form>";
index fbb5e65d344b955bca510caef8d7edce7f4ddb63..9802989d1fbfeb94e5fd784884578321ebbe7111 100644 (file)
@@ -714,7 +714,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
     if ($nextstage != DOWNLOADLANG) {
         $needtoopenform = false;
 ?>
-        <form name="installform" method="post" action="<?php echo $formaction ?>">
+        <form id="installform" method="post" action="<?php echo $formaction ?>">
         <input type="hidden" name="stage" value="<?php echo $nextstage ?>" />
 
 <?php
@@ -916,7 +916,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {
 <?php
     if ($needtoopenform) {
 ?>
-            <form name="installform" method="post" action="<?php echo $formaction ?>">
+            <form id="installform" method="post" action="<?php echo $formaction ?>">
             <input type="hidden" name="stage" value="<?php echo $nextstage ?>" />
 <?php
     }
@@ -1197,8 +1197,8 @@ function database_js() {
 function toggledbinfo() {
     //Calculate selected value
     var showid = 'mysql';
-    if (document.installform.dbtype.value) {
-        showid = document.installform.dbtype.value;
+    if (getElementById('installform').dbtype.value) {
+        showid = getElementById('installform').dbtype.value;
     }
     if (document.getElementById) {
         //Hide all the divs
index 6ab12b88b1990b7b1a42b81456f0468e1445165a..5a24ad79e64e765bbe3de2689bc34d1f5df143bd 100644 (file)
                 html_header($course, $wdir, "form.name");
                 echo "<p>$strrenamefileto:";
                 echo "<table border=\"0\">\n<tr>\n<td>\n";
-                echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\">\n";
+                echo "<form action=\"coursefiles.php\" method=\"post\" id=\"form\">\n";
                 echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
                 echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
                 echo " <input type=\"hidden\" name=\"action\" value=\"rename\" />\n";
@@ -809,7 +809,7 @@ function displaydir ($wdir) {
                    "zip" => "$strcreateziparchive"
                );
     if (!empty($count)) {
-        choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
+        choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:getElementById('dirform').submit()");
     }
     if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
         echo "<form action=\"coursefiles.php\" method=\"get\">\n";
index 034be6c6f85af729583fbc96636081a392e2ee1e..5220572029a1598ee49b1076fc0a0ef596a35ec3 100644 (file)
@@ -51,7 +51,7 @@ border-bottom: 1px solid black; letter-spacing: 2px;
 </head>
 <body>
 <div class="title"><?php print_string("createanchor","editor");?></div>
-<form name="fie">
+<form id="fie">
 <table border="0" cellpadding="2" cellspacing="0">
 <tr>
     <td><?php print_string("anchorname","editor");?>: <input id="f_anc" name="anc" type="text" size="30" /></td>
index 8adeae2824db0d734971c18059d464f0d99c04b4..89d478734cb06ada6b5f3621c5e5245a2d9db402 100644 (file)
@@ -178,7 +178,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
   <div class="space"></div>
   <div class="space"></div>
   <div class="space"></div>
-  <form action="" method="get" name="first" id="first">
+  <form action="" method="get" id="first">
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
         <td width="15%" align="right"><?php print_string("imageurl","editor");?>:</td>
@@ -281,13 +281,13 @@ form { margin-bottom: 0px; margin-top: 0px; }
         <?php if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
         <table border="0" cellpadding="2" cellspacing="0">
           <tr><td><?php print_string("selection","editor");?>: </td>
-          <td><form name="idelete" id="idelete">
+          <td><form id="idelete">
           <input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
-          <td><form name="imove" id="imove">
+          <td><form id="imove">
           <input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></td>
-          <td><form name="izip" id="izip">
+          <td><form id="izip">
           <input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
-          <td><form name="irename" id="irename" method="post" action="../coursefiles.php" target="ibrowser">
+          <td><form id="irename" method="post" action="../coursefiles.php" target="ibrowser">
           <input type="hidden" name="id" value="<?php print($course->id);?>" />
           <input type="hidden" name="wdir" value="" />
           <input type="hidden" name="file" value="" />
@@ -315,7 +315,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
     <tr>
       <td height="22"><?php
       if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
-          <form name="cfolder" id="cfolder" action="../coursefiles.php" method="post" target="ibrowser">
+          <form id="cfolder" action="../coursefiles.php" method="post" target="ibrowser">
           <input type="hidden" name="id" value="<?php print($course->id);?>" />
           <input type="hidden" name="wdir" value="" />
           <input type="hidden" name="action" value="mkdir" />
@@ -324,7 +324,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
           <input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
           </form>
           <div class="space"></div>
-          <form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" name="uploader" target="ibrowser" id="uploader">
+          <form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" target="ibrowser" id="uploader">
           <input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
           <input type="hidden" name="id" VALUE="<?php print($course->id);?>" />
           <input type="hidden" name="wdir" value="" />
index 8e9279e9f8d480db739153e79b8fac55abeca16a..38e245b6684876cc1f3325db71ba29e0072aea7a 100644 (file)
@@ -102,13 +102,13 @@ form { margin-bottom: 1px; margin-top: 1px; }
   <td>
     <table border="0" cellpadding="2" cellspacing="0">
           <tr><td><?php print_string("selection","editor");?>: </td>
-          <td><form name="idelete" id="idelete">
+          <td><form id="idelete">
           <input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
-          <td><form name="imove" id="imove">
+          <td><form  id="imove">
           <input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></form></td>
-          <td><form name="izip" id="izip">
+          <td><form id="izip">
           <input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
-          <td><form name="irename" id="irename" method="post" action="../coursefiles.php" target="fbrowser">
+          <td><form id="irename" method="post" action="../coursefiles.php" target="fbrowser">
           <input type="hidden" name="id" value="<?php print($course->id);?>" />
           <input type="hidden" name="wdir" value="" />
           <input type="hidden" name="file" value="" />
@@ -127,7 +127,7 @@ form { margin-bottom: 1px; margin-top: 1px; }
     <tr>
       <td height="22"><?php
       if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
-          <form name="cfolder" id="cfolder" action="../coursefiles.php" method="post" target="fbrowser">
+          <form id="cfolder" action="../coursefiles.php" method="post" target="fbrowser">
           <input type="hidden" name="id" value="<?php print($course->id);?>" />
           <input type="hidden" name="wdir" value="" />
           <input type="hidden" name="action" value="mkdir" />
@@ -135,7 +135,7 @@ form { margin-bottom: 1px; margin-top: 1px; }
           <input name="name" type="text" id="foldername" size="35" />
           <input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
           </form>
-          <form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" name="uploader" target="fbrowser" id="uploader">
+          <form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" target="fbrowser" id="uploader">
           <input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
           <input type="hidden" name="id" VALUE="<?php print($course->id);?>" />
           <input type="hidden" name="wdir" value="" />
index c7e4444dc1394322932b7acdf450f67e15ad03dd..f015ea8386b947d47f7afaaa595113763dcb4556 100644 (file)
@@ -9,8 +9,10 @@ function popupchecker(msg) {
     }
 }
 
+/*
 function popUpProperties(inobj) {
-  op = window.open();
+/// Legacy function
+  var op = window.open();
   op.document.open('text/plain');
   for (objprop in inobj) {
     op.document.write(objprop + ' => ' + inobj[objprop] + '\n');
@@ -19,6 +21,7 @@ function popUpProperties(inobj) {
 }
 
 function fillmessagebox(text) {
+/// Legacy function
   document.form.message.value = text;
 }
 
@@ -26,27 +29,34 @@ function copyrichtext(textname) {
 /// Legacy stub for old editor - to be removed soon
   return true;
 }
+*/
 
 function checkall() {
-  void(d=document);
-  void(el=d.getElementsByTagName('INPUT'));
-  for(i=0;i<el.length;i++)
-    void(el[i].checked=1)
+  var el = document.getElementsByTagName('input');
+  for(var i=0; i<el.length; i++) {
+    if(el[i].type == 'checkbox') {
+      el[i].checked = true;
+    }
+  }
 }
 
 function checknone() {
-  void(d=document);
-  void(el=d.getElementsByTagName('INPUT'));
-  for(i=0;i<el.length;i++)
-    void(el[i].checked=0)
+  var el = document.getElementsByTagName('input');
+  for(var i=0; i<el.length; i++) {
+    if(el[i].type == 'checkbox') {
+      el[i].checked = false;
+    }
+  }
 }
 
-function lockoptions(form, master, subitems) {
+function lockoptions(formid, master, subitems) {
   // Subitems is an array of names of sub items.
   // Optionally, each item in subitems may have a
   // companion hidden item in the form with the
   // same name but prefixed by "h".
-  if (eval("document."+form+"."+master+".checked")) {
+  var form = document.forms[formid];
+
+  if (eval("form."+master+".checked")) {
     for (i=0; i<subitems.length; i++) {
       unlockoption(form, subitems[i]);
     }
@@ -59,16 +69,16 @@ function lockoptions(form, master, subitems) {
 }
 
 function lockoption(form,item) {
-  eval("document."+form+"."+item+".disabled=true");/* IE thing */
-  if(document.forms[form].elements['h'+item]) {
-    eval("document."+form+".h"+item+".value=1");
+  eval("form."+item+".disabled=true");/* IE thing */
+  if(form.elements['h'+item]) {
+    eval("form.h"+item+".value=1");
   }
 }
 
 function unlockoption(form,item) {
-  eval("document."+form+"."+item+".disabled=false");/* IE thing */
-  if(document.forms[form].elements['h'+item]) {
-    eval("document."+form+".h"+item+".value=0");
+  eval("form."+item+".disabled=false");/* IE thing */
+  if(form.elements['h'+item]) {
+    eval("form.h"+item+".value=0");
   }
 }
 function lockoptionsall(formid) {
@@ -139,7 +149,7 @@ function submitFormById(id) {
     if(!theform) {
         return false;
     }
-    if(theform.tagName != 'FORM') {
+    if(theform.tagName != 'form') {
         return false;
     }
     if(!theform.onsubmit || theform.onsubmit()) {
@@ -148,7 +158,7 @@ function submitFormById(id) {
 }
 
 function select_all_in(elTagName, elClass, elId) {
-    var inputs = document.getElementsByTagName('INPUT');
+    var inputs = document.getElementsByTagName('input');
     inputs = filterByParent(inputs, function(el) {return findParentNode(el, elTagName, elClass, elId);});
     for(var i = 0; i < inputs.length; ++i) {
         if(inputs[i].type == 'checkbox' || inputs[i].type == 'radio') {
index e9edca5cdbd95f48ec4f9de0c56b8943e23f9fdc..381535b71e2d08ef535ba906e277a961afce896f 100644 (file)
@@ -858,15 +858,15 @@ class assignment_base {
         
         echo '<script type="text/javascript">'."\n";
         echo 'function setNext(){'."\n";
-        echo 'document.submitform.mode.value=\'next\';'."\n";
-        echo 'document.submitform.userid.value="'.$nextid.'";'."\n";
+        echo 'getElementById(\'submitform\').mode.value=\'next\';'."\n";
+        echo 'getElementById(\'submitform\').userid.value="'.$nextid.'";'."\n";
         echo '}'."\n";
         
         echo 'function saveNext(){'."\n";
-        echo 'document.submitform.mode.value=\'saveandnext\';'."\n";
-        echo 'document.submitform.userid.value="'.$nextid.'";'."\n";
-        echo 'document.submitform.saveuserid.value="'.$userid.'";'."\n";
-        echo 'document.submitform.menuindex.value = document.submitform.grade.selectedIndex;'."\n";
+        echo 'getElementById(\'submitform\').mode.value=\'saveandnext\';'."\n";
+        echo 'getElementById(\'submitform\').userid.value="'.$nextid.'";'."\n";
+        echo 'getElementById(\'submitform\').saveuserid.value="'.$userid.'";'."\n";
+        echo 'getElementById(\'submitform\').menuindex.value = getElementById(\'submitform\').grade.selectedIndex;'."\n";
         echo '}'."\n";
             
         echo '</script>'."\n";
@@ -922,7 +922,7 @@ class assignment_base {
 
         ///Print Buttons in Single View
         echo '<div class="buttons" align="center">';
-        echo '<input type="submit" name="submit" value="'.get_string('savechanges').'" onclick = "document.submitform.menuindex.value = document.submitform.grade.selectedIndex" />';
+        echo '<input type="submit" name="submit" value="'.get_string('savechanges').'" onclick = "getElementById(\'submitform\').menuindex.value = getElementById(\'submitform\').grade.selectedIndex" />';
         echo '<input type="submit" name="cancel" value="'.get_string('cancel').'" />';
         //if there are more to be graded.
         if ($nextid) {
index ac83366a5a8d33e74fc825678e2c49c2b90951de..a4a3b0f125314fe05ab9aff2e369671686797282 100644 (file)
@@ -37,7 +37,7 @@
 //]]>
 </script>
 
-<form name="form" method="post" action="../mod/assignment/details.php"> 
+<form id="form" method="post" action="../mod/assignment/details.php"> 
 <table cellpadding="5">
 <tr valign="top">
     <td align="right"><b><?php print_string("assignmentname", "assignment") ?>:</b></td>
index c6fcc604c67104428be23367f1a766b22a5f03b8..49774da9c1d588a88c115ca4ed39bc2ba7c04aab 100644 (file)
@@ -85,7 +85,7 @@
         }
         print_heading(get_string("amend", "exercise")." ".get_string("gradeforstudentsassessment",
                     "exercise", $course->student));
-        echo "<form name=\"amendgrade\" method=\"post\" action=\"assessments.php\">\n";
+        echo "<form id=\"amendgrade\" method=\"post\" action=\"assessments.php\">\n";
         echo "<input type=\"hidden\" name=\"aid\" value=\"$aid\" />\n";
         echo "<input type=\"hidden\" name=\"action\" value=\"updategradinggrade\" />\n";
         echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
         // set up heading, form and table
         print_heading_with_help(get_string("editingassessmentelements", "exercise"), "elements", "exercise");
         ?>
-        <form name="form" method="post" action="assessments.php">
+        <form id="form" method="post" action="assessments.php">
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="action" value="insertelements" />
         <center><table cellpadding="5" border="1">
index 414c46827cd57f6acb443a27d37e381932111cb5..a3e400cdf7feaa63f402932e1ae325ac2096d980 100644 (file)
@@ -1567,7 +1567,7 @@ function exercise_print_assessment_form($exercise, $assessment = false, $allowch
     // now print the grading form with the teacher's comments if any
     // FORM is needed for Mozilla browsers, else radio bttons are not checked
         ?>
-    <form name="assessmentform" method="post" action="assessments.php">
+    <form id="assessmentform" method="post" action="assessments.php">
     <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
     <input type="hidden" name="aid" value="<?php echo $assessment->id ?>" />
     <input type="hidden" name="action" value="updateassessment" />
@@ -2017,9 +2017,9 @@ function exercise_print_assessment_form($exercise, $assessment = false, $allowch
         if (isteacher($course->id)) { 
             // ...show two buttons...to resubmit or not to resubmit
             echo "<input type=\"button\" value=\"".get_string("studentnotallowed", "exercise", $course->student)."\" 
-                onclick=\"document.assessmentform.submit();\" />\n";
+                onclick=\"getElementById('assessmentform').submit();\" />\n";
             echo "<input type=\"button\" value=\"".get_string("studentallowedtoresubmit", "exercise", $course->student)."\" 
-                onclick=\"document.assessmentform.resubmit.value='1';document.assessmentform.submit();\" />\n";
+                onclick=\"getElementById('assessmentform').resubmit.value='1';getElementById('assessmentform').submit();\" />\n";
             }
         else {
             // ... show save button
@@ -2368,7 +2368,7 @@ function exercise_print_teacher_assessment_form($exercise, $assessment, $submiss
     echo "</td></tr></table></center><br clear=\"all\" />\n";
 
     ?>
-    <form name="assessmentform" method="post" action="assessments.php">
+    <form id="assessmentform" method="post" action="assessments.php">
     <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
     <input type="hidden" name="said" value="<?php echo $assessment->id ?>" />
     <input type="hidden" name="sid" value="<?php echo $submission->id ?>" />
@@ -2784,9 +2784,9 @@ function exercise_print_teacher_assessment_form($exercise, $assessment, $submiss
     // ...and close the table and show two buttons...to resubmit or not to resubmit
     echo "</table>\n";
     echo "<br /><input type=\"button\" value=\"".get_string("studentnotallowed", "exercise", $course->student)."\" 
-        onclick=\"document.assessmentform.submit();\" />\n";
+        onclick=\"getElementById('assessmentform').submit();\" />\n";
     echo "<input type=\"button\" value=\"".get_string("studentallowedtoresubmit", "exercise", $course->student)."\" 
-        onclick=\"document.assessmentform.resubmit.value='1';document.assessmentform.submit();\" />\n";
+        onclick=\"getElementById('assessmentform').resubmit.value='1';getElementById('assessmentform').submit();\" />\n";
     echo "</center></form>\n";
 }
 
index de637461c2cc9790aeebe3ab27dae04383308cfd..88e63ad4e565d910dd945ecf95ba4398d2a80fe5 100644 (file)
@@ -69,7 +69,7 @@
         $submission = get_record("exercise_submissions", "id", $sid);
         print_heading(get_string("amendtitle", "exercise"));
         ?>
-        <form name="amendtitleform" action="submissions.php" method="post">
+        <form id="amendtitleform" action="submissions.php" method="post">
         <input type="hidden" name="action" value="adminupdatetitle" />
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="sid" value="<?php echo $sid ?>" />
index 12dc33e96b117461a67a05b3220c56067facf719..6ae1121b8557562b069babbeff59482d0ce2b25c 100644 (file)
 
             if (!$correctpass) {
                 print_simple_box_start("center");
-                echo "<form name=\"password\" method=\"post\" action=\"view.php\">\n";
+                echo "<form id=\"password\" method=\"post\" action=\"view.php\">\n";
                 echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
                 echo "<table cellpadding=\"7px\">";
                 if (isset($_POST['userpassword'])) {
index c18275ec177c8ef8c6c73ac283941d198a436083..29015ce56841f6d122f7a7bab1a52220f334f590 100644 (file)
@@ -275,7 +275,7 @@ function forum_print_big_search_form($course) {
     echo "var timetoitems = ['today','tomonth','toyear','tohour','tominute'];\n";
     echo "</script>\n";
 
-    echo '<form name="search" action="search.php" method="get">';
+    echo '<form id="searchform" action="search.php" method="get">';
     echo '<input type="hidden" value="'.$course->id.'" name="id" alt="" />';
     echo '<table cellpadding="10" class="searchbox" id="form">';
 
@@ -304,7 +304,7 @@ function forum_print_big_search_form($course) {
     echo '<tr>';
     echo '<td class="c0">'.get_string('searchdatefrom', 'forum').':</td>';
     echo '<td class="c1">';
-    echo '<input name="timefromrestrict" type="checkbox" value="1" alt="'.get_string('searchdatefrom', 'forum').'" onclick="return lockoptions(\'search\', \'timefromrestrict\', timefromitems)" /> ';
+    echo '<input name="timefromrestrict" type="checkbox" value="1" alt="'.get_string('searchdatefrom', 'forum').'" onclick="return lockoptions(\'searchform\', \'timefromrestrict\', timefromitems)" /> ';
     if (empty($dateto)) {
         $datefrom = make_timestamp(2000, 1, 1, 0, 0, 0);
     }
@@ -323,7 +323,7 @@ function forum_print_big_search_form($course) {
     echo '<tr>';
     echo '<td class="c0">'.get_string('searchdateto', 'forum').':</td>';
     echo '<td class="c1">';
-    echo '<input name="timetorestrict" type="checkbox" value="1" alt="'.get_string('searchdateto', 'forum').'" onclick="return lockoptions(\'search\', \'timetorestrict\', timetoitems)" /> ';
+    echo '<input name="timetorestrict" type="checkbox" value="1" alt="'.get_string('searchdateto', 'forum').'" onclick="return lockoptions(\'searchform\', \'timetorestrict\', timetoitems)" /> ';
     if (empty($dateto)) {
         $dateto = time()+3600;
     }
@@ -365,8 +365,8 @@ function forum_print_big_search_form($course) {
     echo '</form>';
 
     echo "<script type=\"text/javascript\">";
-    echo "lockoptions('search','timefromrestrict', timefromitems);";
-    echo "lockoptions('search','timetorestrict', timetoitems);";
+    echo "lockoptions('searchform','timefromrestrict', timefromitems);";
+    echo "lockoptions('searchform','timetorestrict', timetoitems);";
     echo "</script>\n";
 
     print_simple_box_end();
index 7dddc45aa58b452679256fd8ea30aa57bf233c95..e69a7b236d2893d1e3352ef7b2b7383ed8d548f6 100644 (file)
@@ -60,7 +60,7 @@ $text_source_options = array(
 //]]>
 </script>
 <center>
-<form name="form" method="post" action="mod.php">
+<form id="form" method="post" action="mod.php">
 <table cellpadding="5">
     <tr valign="top">
         <td align="right"><b><?php print_string("name") ?>:</b></td>
@@ -371,7 +371,7 @@ $text_source_options = array(
     // override the standard Moodle "setfocus" function, 
     // which gives a js error if the "name" field is hidden
     function setfocus() {
-       var f = document.form;
+       var f = getElementById('form');
        if (f) {
                if (canfocus(f, 'namesource')) {
                        f.namesource.focus();
index 15778b97852181a01cbeb5c22f99ba705260469f..6c0c4bb1fbffab39ba9652ffffa365963f34a9e7 100644 (file)
@@ -33,7 +33,7 @@ if (!isset($form->create_sequence_url)) {
 }
 ?>
 
-<form name="form" method="post" action="mod.php" onSubmit="disableSumbit(this);">
+<form id="form" method="post" action="mod.php" onSubmit="disableSumbit(this);">
 <center>
 <span id="message"><p>Please wait .......</p></span>
 <table cellpadding="5">
@@ -229,7 +229,7 @@ function refreshLists(){
     dol = new DynamicOptionList("workspace","sequence");
     dol.setFormName("form");
 
-    url = "../mod/lams/list.php?courseid="+document.form.course.value;
+    url = "../mod/lams/list.php?courseid="+getElementById('form').course.value;
     if (window.XMLHttpRequest) { // Non-IE browsers
         req = new XMLHttpRequest();
         req.onreadystatechange = processStateChange;
index 88746acfff8506be4483fb4b98427ade359a0989..b9c59c71787c7ce126d720691a850302b877ab34 100644 (file)
@@ -72,7 +72,7 @@
             
 <?php } ?>
 
-            <form name="pageform" method ="post" action="<?php echo $CFG->wwwroot ?>/mod/lesson/view.php">
+            <form id="pageform" method ="post" action="<?php echo $CFG->wwwroot ?>/mod/lesson/view.php">
             <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
             <input type="hidden" name="pageid" value="<?php echo $newpageid ?>" />
 
index 217219b7975f3d9306a5088e9fdd1fc996e88d57..113c6fb8d20ddeb3f760786250adb1532c910fd1 100644 (file)
                 if (!$highscores or $madeit) {
                     echo '<p>'.get_string("youmadehighscore", "lesson", $lesson->maxhighscores).
                          '</p><p>
-                          <form method="post" name="highscores" action="'.$CFG->wwwroot.'/mod/lesson/highscores.php">
+                          <form method="post" id="highscores" action="'.$CFG->wwwroot.'/mod/lesson/highscores.php">
                           <input type="hidden" name="mode" value="add" />
                           <input type="hidden" name="id" value="'.$cm->id.'" />
                           <input type="hidden" name="sesskey" value="'.sesskey().'" />
index b5fdd2a9948e610c8680833d5d24497bed0666de..a96de083e392a091bb942653de6be279b82861bc 100644 (file)
@@ -87,7 +87,7 @@
 //]]>
 </script>
 
-<form method="post" action="module.php" name="form">
+<form method="post" action="module.php" id="form">
 <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
 
 <!-- Table of default values -->
index 1f4d91806b0183f7970ed006febd674ae59c7cc9..02e1c0daf80f5d11bfe7e5fbb110a1690fb39277 100644 (file)
@@ -1,4 +1,4 @@
-<form method="post" action="module.php" name="form">
+<form method="post" action="module.php" id="form">
 <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
 
 <table cellpadding="9" cellspacing="0" >
index e260d0bcece6a02dd413e3babe96b54581227099..ee818d42a2de35bf7112c8813f7617469f113e6f 100644 (file)
@@ -1,4 +1,4 @@
-<form name="form" method="post" action="<?php echo "$CFG->wwwroot/course/mod.php" ?>">
+<form id="form" method="post" action="<?php echo "$CFG->wwwroot/course/mod.php" ?>">
 
 <input type="hidden" name="type"         value="<?php p($form->type) ?>" />
 <input type="hidden" name="course"       value="<?php p($form->course) ?>" />
index f953081081e93f446f4f20aea0a319fffe0bfeb1..c84728606bf55f55e000590403e725f715aa5ba6 100644 (file)
     
     <br />
     <div align="center" class="form">
-    <form name="myform">
+    <form id="myform">
     <input type="file" size="60" name="myfile"><br />
     <input type="button" value="<?php print_string('localfileselect','resource') ?>" 
-           onClick="return set_value(document.myform.myfile.value)">
+           onClick="return set_value(getElementById('myform').myfile.value)">
     <input type="button" value="<?php print_string('cancel') ?>" 
            onClick="window.close()">
     </form>
index 09bd9100fb8bffb1c226f3fd816c8ed1560aa89a..6a51d248b4852b8095fe85b2bf2fae64c438cae6 100644 (file)
         } else if (txt.indexOf('\\') > -1) {
             txt = txt.substring(0,txt.lastIndexOf('\\'));
         }
-        document.myform.pathname.value = txt;
-        document.myform.submit();
+        getElementById('myform').pathname.value = txt;
+        getElementById('myform').submit();
     }
     //]]>
     </script>
     
     <br />
     <div align="center" class="form">
-    <form name="myform" action="localpath.php" method="post">
+    <form id="myform" action="localpath.php" method="post">
     <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>">
     <input type="hidden" name="pathname" value="">
     <input type="file" size="60" name="myfile"><br />
     <input type="button" value="<?php print_string('localfileselect','resource') ?>" 
-           onClick="return set_value(document.myform.myfile.value)">
+           onClick="return set_value(getElementById('myform').myfile.value)">
     <input type="button" value="<?php print_string('cancel') ?>" 
            onClick="window.close()">
     </form>
index 0df673eab90b5ab999c18e9a62c4870796520f16..474bf6429f993799eb350ac3548a4644a8e7a29c 100644 (file)
@@ -40,7 +40,7 @@ $query .= '&HIVE_SESSION='.$SESSION->HIVE_SESSION;
 /***********8
     notify('Opening HarvestRoad Hive. Please wait. Contacting '. $CFG->hivehost );
 
-    echo '<form name="OPEN_HIVE_FORM" action="'. $CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'" method="post">';
+    echo '<form id="OPEN_HIVE_FORM" action="'. $CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'" method="post">';
 
     echo '<input type="hidden" name="HISTORY" value="">';
     echo '<input type="hidden" name="hiveLanguage" value="en_AU">';
@@ -62,7 +62,7 @@ $query .= '&HIVE_SESSION='.$SESSION->HIVE_SESSION;
     echo '</form>';
     echo '<script type="text/javascript"/>';
     echo "\n//<![CDATA[\n";
-    echo 'document.OPEN_HIVE_FORM.submit();';
+    echo 'getElementById(\'OPEN_HIVE_FORM\').submit();';
     echo "\n//]]>\n";
     echo '</script>';
 
index e546cf5e4fb8315e89b966e681824ca2edd8415c..d53ae225a86b67b402504630128368a9dbb3a80f 100755 (executable)
     }
 </script>
 
-<form name="form" method="post" action="mod.php?goto=" onsubmit="return validate_scorm(document.form,document.form.reference.value,false)">
+<form id="form" method="post" action="mod.php?goto=" onsubmit="return validate_scorm(getElementById('form'),getElementById('form').reference.value,false)">
     <table cellpadding="5">
         <tr valign="top">
             <td align="right"><b><?php print_string('name') ?>:</b></td>
             <td align="right"><b><?php print_string('grademethod', 'scorm') ?>:</b></td>
             <td>
             <?php
-                choose_from_menu($SCORM_GRADE_METHOD, 'grademethod', (int) $form->grademethod, '','checkscormform(this,0,document.form.maxgrade);');
+                choose_from_menu($SCORM_GRADE_METHOD, 'grademethod', (int) $form->grademethod, '','checkscormform(this,0,getElementById(\'form\').maxgrade);');
                 helpbutton('grademethod', get_string('grademethod','scorm'), 'scorm');
             ?>
             </td>
                         $attempts[$i] = $i . ' ' . get_string('attempts','scorm');
                     }
                 }
-                choose_from_menu($attempts, 'maxattempt', (int) $form->maxattempt, get_string('nolimit','scorm'),'checkscormform(this,1,document.form.whatgrade);');
+                choose_from_menu($attempts, 'maxattempt', (int) $form->maxattempt, get_string('nolimit','scorm'),'checkscormform(this,1,getElementById(\'form\').whatgrade);');
                 helpbutton('maxattempt', get_string('maximumattempts','scorm'), 'scorm');
             ?>
             </td>
index 910c6fc575663a1a17b743ed53ff4d3b982cce8e..942056b3aa569936a337ecea339db7b6062f0655 100644 (file)
@@ -163,7 +163,7 @@ function checkform() {
 
     var error=false;
 
-    with (document.form) {
+    with (getElementById('form')) {
     <?php
        if (!empty($checklist)) {
            foreach ($checklist as $question => $default) {
@@ -176,7 +176,7 @@ function checkform() {
     if (error) {
         alert("<?php print_string("questionsnotanswered", "survey") ?>");
     } else {
-        document.form.submit();
+        getElementById('form').submit();
     }
 }
 
index ca674fc5bac718d6d033aacd71215c44e2c5fd47..e8f753deac0d5f2ff5212ebee2e11b3225a3be5d 100644 (file)
             error("Edit Comment: Submission not found");
             }
         ?>
-        <form name="gradingform" action="assessments.php" method="post">
+        <form id="gradingform" action="assessments.php" method="post">
         <input type="hidden" name="action" value="updatecomment" />
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="cid" value="<?php echo $cid ?>" />
         // set up heading, form and table
         print_heading_with_help(get_string("editingassessmentelements", "workshop"), "elements", "workshop");
         ?>
-        <form name="form" method="post" action="assessments.php">
+        <form id="form" method="post" action="assessments.php">
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="action" value="insertelements" />
         <center><table cellpadding="5" border="1">
index f2cd55f03fdb040970143deff8ad4626c2dddcd7..23223b514fdfa7b900be94a0d7af7ea177068a1f 100644 (file)
@@ -2138,17 +2138,17 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                 if ($allowchanges and workshop_is_teacher($workshop, $USER->id)) {
                     echo "<tr><td valign=\"top\" align=\"right\"><input type=\"button\" value=\"".
                         get_string("addcomment", "workshop")."\" 
-                        onclick=\"document.assessmentform.action.value='addstockcomment';
-                        document.assessmentform.elementno.value=$i;document.assessmentform.submit();\" /> \n";
+                        onclick=\"getElementById('assessmentform').action.value='addstockcomment';
+                        getElementById('assessmentform').elementno.value=$i;getElementById('assessmentform').submit();\" /> \n";
                     helpbutton("addcommenttobank", get_string("addcomment", "workshop"), "workshop");
                     echo "</td><td>\n";
                     if ($stockcomments = get_records_select("workshop_stockcomments", "workshopid = $workshop->id
                             AND elementno = $i", "id")) { // show comments in fixed order (oldest first)
                         foreach ($stockcomments as $stockcomment) {
-                            echo "<a onclick=\"document.assessmentform.feedback_$i.value+=' '+'".
+                            echo "<a onclick=\"getElementById('assessmentform').feedback_$i.value+=' '+'".
                                 addslashes($stockcomment->comments)."';\">&lt;&lt;$stockcomment->comments&gt;&gt;</a>\n";
                             if (workshop_is_teacheredit($workshop, $USER->id)) {
-                                echo " <a onclick=\"document.assessmentform.action.value='removestockcomment';document.assessmentform.stockcommentid.value=$stockcomment->id;document.assessmentform.submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
+                                echo " <a onclick=\"getElementById('assessmentform').action.value='removestockcomment';getElementById('assessmentform').stockcommentid.value=$stockcomment->id;getElementById('assessmentform').submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
                             }
                             echo "<br />\n";
                         }
@@ -2242,18 +2242,18 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                 if ($allowchanges and workshop_is_teacher($workshop, $USER->id)) {
                     echo "<tr><td valign=\"top\" align=\"right\"><input type=\"button\" value=\"".
                         get_string("addcomment", "workshop")."\" 
-                        onclick=\"document.assessmentform.action.value='addstockcomment';
-                        document.assessmentform.elementno.value=$i;document.assessmentform.submit();\" /> \n";
+                        onclick=\"getElementById('assessmentform').action.value='addstockcomment';
+                        getElementById('assessmentform').elementno.value=$i;getElementById('assessmentform').submit();\" /> \n";
                     helpbutton("addcommenttobank", get_string("addcomment", "workshop"), "workshop");
                     echo "</td><td>\n";
                     if ($stockcomments = get_records_select("workshop_stockcomments", "workshopid = $workshop->id
                             AND elementno = $i", "id")) { // get comments in a fixed order - oldest first
                         foreach ($stockcomments as $stockcomment) {
-                            echo "<a onclick=\"document.assessmentform.feedback_$i.value+=' '+'".
+                            echo "<a onclick=\"getElementById('assessmentform').feedback_$i.value+=' '+'".
                                 addslashes($stockcomment->comments).
                                 "';\">&lt;&lt;$stockcomment->comments&gt;&gt;</a>\n";
                             if (workshop_is_teacheredit($workshop, $USER->id)) {
-                                echo " <a onclick=\"document.assessmentform.action.value='removestockcomment';document.assessmentform.stockcommentid.value=$stockcomment->id;document.assessmentform.submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
+                                echo " <a onclick=\"getElementById('assessmentform').action.value='removestockcomment';getElementById('assessmentform').stockcommentid.value=$stockcomment->id;getElementById('assessmentform').submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
                             }
                             echo "<br />\n";
                         }
@@ -2347,18 +2347,18 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                 if ($allowchanges and workshop_is_teacher($workshop, $USER->id)) {
                     echo "<tr><td valign=\"top\" align=\"right\"><input type=\"button\" value=\"".
                         get_string("addcomment", "workshop")."\" 
-                        onclick=\"document.assessmentform.action.value='addstockcomment';
-                        document.assessmentform.elementno.value=$i;document.assessmentform.submit();\" /> \n";
+                        onclick=\"getElementById('assessmentform').action.value='addstockcomment';
+                        getElementById('assessmentform').elementno.value=$i;getElementById('assessmentform').submit();\" /> \n";
                     helpbutton("addcommenttobank", get_string("addcomment", "workshop"), "workshop");
                     echo "</td><td>\n";
                     if ($stockcomments = get_records_select("workshop_stockcomments", "workshopid = $workshop->id
                             AND elementno = $i", "id")) { // get comments in a fixed order - oldest first
                         foreach ($stockcomments as $stockcomment) {
-                            echo "<a onclick=\"document.assessmentform.feedback_$i.value+=' '+'".
+                            echo "<a onclick=\"getElementById('assessmentform').feedback_$i.value+=' '+'".
                                 addslashes($stockcomment->comments).
                                 "';\">&lt;&lt;$stockcomment->comments&gt;&gt;</a>\n";
                             if (workshop_is_teacheredit($workshop, $USER->id)) {
-                                echo " <a onclick=\"document.assessmentform.action.value='removestockcomment';document.assessmentform.stockcommentid.value=$stockcomment->id;document.assessmentform.submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
+                                echo " <a onclick=\"getElementById('assessmentform').action.value='removestockcomment';getElementById('assessmentform').stockcommentid.value=$stockcomment->id;getElementById('assessmentform').submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
                             }
                             echo "<br />\n";
                         }
@@ -2510,18 +2510,18 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
                     if ($allowchanges and workshop_is_teacher($workshop, $USER->id)) {
                     echo "<tr><td valign=\"top\" align=\"right\"><input type=\"button\" value=\"".
                         get_string("addcomment", "workshop")."\" 
-                        onclick=\"document.assessmentform.action.value='addstockcomment';
-                        document.assessmentform.elementno.value=$i;document.assessmentform.submit();\" /> \n";
+                        onclick=\"getElementById('assessmentform').action.value='addstockcomment';
+                        getElementById('assessmentform').elementno.value=$i;getElementById('assessmentform').submit();\" /> \n";
                     helpbutton("addcommenttobank", get_string("addcomment", "workshop"), "workshop");
                     echo "</td><td>\n";
                         if ($stockcomments = get_records_select("workshop_stockcomments", "workshopid = $workshop->id
                                     AND elementno = $i", "id")) { // show comments in fixed (creation) order
                             foreach ($stockcomments as $stockcomment) {
-                                echo "<a onclick=\"document.assessmentform.feedback_$i.value+=' '+'".
+                                echo "<a onclick=\"getElementById('assessmentform').feedback_$i.value+=' '+'".
                                     addslashes($stockcomment->comments).
                                     "';\">&lt;&lt;$stockcomment->comments&gt;&gt;</a>\n";
                                 if (workshop_is_teacheredit($workshop, $USER->id)) {
-                                    echo " <a onclick=\"document.assessmentform.action.value='removestockcomment';document.assessmentform.stockcommentid.value=$stockcomment->id;document.assessmentform.submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
+                                    echo " <a onclick=\"getElementById('assessmentform').action.value='removestockcomment';getElementById('assessmentform').stockcommentid.value=$stockcomment->id;getElementById('assessmentform').submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
                                 }
                                 echo "<br />\n";
                             }
@@ -2571,17 +2571,17 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
     if ($allowchanges and workshop_is_teacher($workshop, $USER->id)) {
         echo "<tr><td valign=\"top\" align=\"right\"><input type=\"button\" value=\"".
             get_string("addcomment", "workshop")."\" 
-            onclick=\"document.assessmentform.action.value='addstockcomment';
-        document.assessmentform.elementno.value=99;document.assessmentform.submit();\" /> \n";
+            onclick=\"getElementById('assessmentform').action.value='addstockcomment';
+        getElementById('assessmentform').elementno.value=99;getElementById('assessmentform').submit();\" /> \n";
         helpbutton("addcommenttobank", get_string("addcomment", "workshop"), "workshop");
         echo "</td><td>\n";
         if ($stockcomments = get_records_select("workshop_stockcomments", "workshopid = $workshop->id
                     AND elementno = 99", "id")) { // show in the same order (oldest at the top)
             foreach ($stockcomments as $stockcomment) {
-                echo "<a onclick=\"document.assessmentform.generalcomment.value+=' '+'".
+                echo "<a onclick=\"getElementById('assessmentform').generalcomment.value+=' '+'".
                     addslashes($stockcomment->comments)."';\">&lt;&lt;$stockcomment->comments&gt;&gt;</a>\n";
                 if (workshop_is_teacheredit($workshop, $USER->id)) {
-                    echo " <a onclick=\"document.assessmentform.action.value='removestockcomment';document.assessmentform.stockcommentid.value=$stockcomment->id;document.assessmentform.submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
+                    echo " <a onclick=\"getElementById('assessmentform').action.value='removestockcomment';getElementById('assessmentform').stockcommentid.value=$stockcomment->id;getElementById('assessmentform').submit();\"> <small><i>&lt;--".get_string("delete","workshop")."</i></small></a>\n";
                 }
                 echo "<br />\n";
             }
@@ -2630,9 +2630,9 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
         if (($submission->userid == $USER->id) and !$assessment->timeagreed and !$comments and $showcommentlinks and 
                 $submission->userid != $assessment->userid) {
             echo "<input type=\"button\" value=\"".get_string("agreetothisassessment", "workshop")."\" 
-                onclick=\"document.assessmentform.action.value='agreeassessment';document.assessmentform.submit();\" />\n";
+                onclick=\"getElementById('assessmentform').action.value='agreeassessment';getElementById('assessmentform').submit();\" />\n";
             echo "<input type=\"submit\" value=\"".get_string("disagreewiththisassessment", "workshop")."\"
-                onclick=\"document.assessmentform.action.value='addcomment';document.assessmentform.submit();\" />\n";
+                onclick=\"getElementById('assessmentform').action.value='addcomment';getElementById('assessmentform').submit();\" />\n";
         }
     }
     echo "</center>";
index f324209a342bc09696fd141c3f3b0071f5637f9d..69c77a0e68bbf859226eab940e58b5e481a6b9cc 100644 (file)
             error(get_string('notallowed', 'workshop'));
         }
         ?>
-        <form name="editform" enctype="multipart/form-data" action="submissions.php" method="post">
+        <form id="editform" enctype="multipart/form-data" action="submissions.php" method="post">
         <input type="hidden" name="action" value="updatesubmission" />
         <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
         <input type="hidden" name="sid" value="<?php echo $sid ?>" />
                 if ($files = get_directory_list($basedir)) {
                     echo "<tr><td><b>".get_string("attachments", "workshop").
                         "</b><div align=\"right\"><input type=\"button\" value=\"".get_string("removeallattachments",
-                        "workshop")."\" onclick=\"document.editform.action.value='removeattachments';
-                        document.editform.submit();\"/></div></td></tr>\n";
+                        "workshop")."\" onclick=\"getElementById('editform').action.value='removeattachments';
+                        getElementById('editform').submit();\"/></div></td></tr>\n";
                     $n = 1;
                     foreach ($files as $file) {
                         $icon = mimeinfo("icon", $file);
index 653d58559cfa8391bb5d2b0208d117b09906e784..3d0b505f1235285ba008a4158719aecbff55447d 100644 (file)
@@ -169,7 +169,7 @@ function question_category_form($course, $current, $recurse=1, $showhidden=false
     echo "<input type=\"submit\" value=\"$streditcats\" />";
     echo "</form>";
     echo '</td></tr></table>';
-    echo '<form method="post" action="edit.php" name="displayoptions">';
+    echo '<form method="post" action="edit.php" id="displayoptions">';
     echo '<table><tr><td>';
     echo "<input type=\"hidden\" name=\"courseid\" value=\"{$course->id}\" />";
     echo '<input type="hidden" name="recurse" value="0" />';
@@ -177,7 +177,7 @@ function question_category_form($course, $current, $recurse=1, $showhidden=false
     if ($recurse) {
         echo ' checked="checked"';
     }
-    echo ' onchange="document.displayoptions.submit(); return true;" />';
+    echo ' onchange="getElementById(\'displayoptions\').submit(); return true;" />';
     print_string('recurse', 'quiz');
     // hide-feature
     echo '<br />';
@@ -186,7 +186,7 @@ function question_category_form($course, $current, $recurse=1, $showhidden=false
     if ($showhidden) {
         echo ' checked="checked"';
     }
-    echo ' onchange="document.displayoptions.submit(); return true;" />';
+    echo ' onchange="getElementById(\'displayoptions\').submit(); return true;" />';
     print_string('showhidden', 'quiz');
     echo '</td><noscript><td valign="center">';
     echo ' <input type="submit" value="'. get_string('go') .'" />';
index 8e440863125beeee7b056ab31d4c1da65a04c376..9f20241f5bca32506a41f4cd2325b1c8ce3c967a 100644 (file)
  
     ?>
 
-    <form name="form" enctype="multipart/form-data" method="post" action="import.php">
+    <form id="form" enctype="multipart/form-data" method="post" action="import.php">
         <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
         <?php print_simple_box_start("center"); ?>
         <table cellpadding="5">
index 6bad383d97250b6cd3fbbc344dcb6ac14c84551b..bbce4dc60d529ccf91b32622c70f50c8e25754cb 100644 (file)
@@ -89,7 +89,7 @@ $QTYPES[$question->qtype]->print_question_form_end($question,
 function determineMinAndMax() {
     // This client-side script will determine the values for min and max
     // based on the input for answer and acceptederror.
-    with(document.theform) {
+    with(getElementById('theform')) {
         if (formula0.value=='') {
             alert('<?php  print_string("missingformula","quiz") ?>');
             return false;
@@ -103,8 +103,8 @@ function determineMinAndMax() {
         } else if (isNaN(tolerance0.value)) {
             alert('<?php  print_string("tolerancemustbenumeric","quiz") ?>');
             return false;
-        } else if ('2' == document.theform['correctanswerformat[]'].value
-                && '0' == document.theform['correctanswerlength[]'].value) {
+        } else if ('2' == getElementById('theform')['correctanswerformat[]'].value
+                && '0' == getElementById('theform')['correctanswerlength[]'].value) {
             alert('<?php  print_string("zerosignificantfiguresnotallowed","quiz") ?>');
             return false;
         } else {
index 3131630dec2402cbf2f57acc4db01b8c61153b63..1b87bfe4b7090bcc26f5f9532ede686795404ae2 100644 (file)
@@ -337,7 +337,7 @@ class question_calculated_qtype extends question_dataset_dependent_questiontype
                                                 : 'significantfigures'), 'quiz', $i);
             }
             return '<input type="submit" onClick="'
-                    . "document.addform.regenerateddefid.value='$defid'; return true;"
+                    . "getElementById('addform').regenerateddefid.value='$defid'; return true;"
                     .'" value="'. get_string('generatevalue', 'quiz') . '"/><br/>'
                     . '<input type="text" size="3" name="calcmin[]" '
                     . " value=\"$regs[2]\"/> &amp; <input name=\"calcmax[]\" "
index 676a26f7f782d3e86a98b47b6eb0145c4f1582b7..6b91adf8d9f181bcc4328c3b3fc5f5ca5d4a7ae9 100644 (file)
 
 // Print the new-dataset table
     $addtable->data = array($addline);
-    echo "<form name=\"addform\" method=\"post\" action=\"question.php\">
+    echo "<form id=\"addform\" method=\"post\" action=\"question.php\">
             <input type=\"hidden\" name=\"regenerateddefid\" value=\"0\"/>
             <input type=\"hidden\" name=\"id\" value=\"$question->id\"/>
             <input type=\"hidden\" name=\"category\" value=\"$question->category\"/>
index 37343f4c75fe88d202853c75dc20e348596d2e2d..40ab32ef08c1c661fde3678c6b23609dbe0ac5a6 100644 (file)
@@ -1,4 +1,4 @@
-<form name="theform" method="post" action="question.php">
+<form id="theform" method="post" action="question.php">
 <center>
 <table cellpadding="5">
 <?php if (!empty($datasets)) { ?>
index d1144454fcc39aaf51d301a81456c7f99de1b8eb..9f022e51d2ad62d4165fe047a2a46b02e230076f 100644 (file)
@@ -1,4 +1,4 @@
-<form name="theform" method="post" action="question.php">
+<form id="theform" method="post" action="question.php">
 <center>
 <table cellpadding="5">
 
index 5a51a9325bc13479c68fa79cc2ed9d9784ae681c..1c131f84d1e2d5132f37955d28ee259e7a01d2a2 100644 (file)
@@ -1,4 +1,4 @@
-<form name="theform" method="post" action="question.php">
+<form id="theform" method="post" action="question.php">
 <center>
 <table cellpadding="5">
 
index fb650b9d37f1d8aa953228c5100e17f9447953c3..fde1610c04b62d781d219270da410cd78766280a 100644 (file)
@@ -1,4 +1,4 @@
-<form name="theform" method="post" action="question.php">
+<form id="theform" method="post" action="question.php">
 <table cellpadding="5">
 
 <tr valign="top">