Revision: 1303
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1303&view=rev
Author:   cimorrison
Date:     2010-03-14 21:37:43 +0000 (Sun, 14 Mar 2010)

Log Message:
-----------
- Removed the Submit button from Area and Room select forms when JavaScript is 
enabled as they are redundant.
- Minor tidy up of JavaScript

Modified Paths:
--------------
    mrbs/trunk/web/functions.inc
    mrbs/trunk/web/mrbs-js-overrides.css.php

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2010-03-03 17:48:43 UTC (rev 1302)
+++ mrbs/trunk/web/functions.inc        2010-03-14 21:37:43 UTC (rev 1303)
@@ -665,7 +665,7 @@
   $out_html = "
 <form id=\"areaChangeForm\" method=\"get\" action=\"$link\">
   <div>
-    <select name=\"area\" 
onchange=\"document.forms['areaChangeForm'].submit()\">";
+    <select name=\"area\" onchange=\"this.form.submit()\">";
   
     $sql = "select id, area_name from $tbl_area order by area_name";
     $res = sql_query($sql);
@@ -678,13 +678,14 @@
       <option $selected value=\"". $row['id']. "\">" . 
htmlspecialchars($row['area_name']) . "</option>";
       }
     }
+    // Note:  the submit button will not be displayed if JavaScript is enabled
     $out_html .= "
     </select>
   
     <input type=\"hidden\" name=\"day\"   value=\"$day\">
     <input type=\"hidden\" name=\"month\" value=\"$month\">
     <input type=\"hidden\" name=\"year\"  value=\"$year\">
-    <input type=\"submit\" value=\"".get_vocab("change")."\">
+    <input type=\"submit\" class=\"js_none\" value=\"".get_vocab("change")."\">
     </div>
 </form>\n";
 
@@ -697,7 +698,7 @@
   $out_html = "
 <form id=\"roomChangeForm\" method=\"get\" action=\"$link\">
   <div>
-    <select name=\"room\" 
onchange=\"document.forms['roomChangeForm'].submit()\">";
+    <select name=\"room\" onchange=\"this.form.submit()\">";
   
     $sql = "select id, room_name from $tbl_room where area_id=$area order by 
sort_key";
     $res = sql_query($sql);
@@ -710,13 +711,14 @@
       <option $selected value=\"". $row['id']. "\">" . 
htmlspecialchars($row['room_name']) . "</option>";
       }
     }
+    // Note:  the submit button will not be displayed if JavaScript is enabled
     $out_html .= "
     </select>
     <input type=\"hidden\" name=\"day\"   value=\"$day\">
     <input type=\"hidden\" name=\"month\" value=\"$month\">
     <input type=\"hidden\" name=\"year\"  value=\"$year\">
     <input type=\"hidden\" name=\"area\"  value=\"$area\">
-    <input type=\"submit\" value=\"".get_vocab("change")."\">
+    <input type=\"submit\" class=\"js_none\" value=\"".get_vocab("change")."\">
   </div>
 </form>\n";
 

Modified: mrbs/trunk/web/mrbs-js-overrides.css.php
===================================================================
--- mrbs/trunk/web/mrbs-js-overrides.css.php    2010-03-03 17:48:43 UTC (rev 
1302)
+++ mrbs/trunk/web/mrbs-js-overrides.css.php    2010-03-14 21:37:43 UTC (rev 
1303)
@@ -17,3 +17,11 @@
     display: block;   /* if JavaScript is enabled then we want to see the 
JavaScript controls */
   }
 .multiple_booking .maxi a {padding-left: <?php echo $main_cell_height + 
$main_table_cell_border_width + 2 ?>px}
+
+<?php
+// Don't display anything with a class of js_none (used for example for hiding 
Submit
+// buttons when we're submitting onchange)
+?>
+.js_none {
+    display: none;
+  }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to