Revision: 1285
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1285&view=rev
Author:   cimorrison
Date:     2009-12-13 19:34:50 +0000 (Sun, 13 Dec 2009)

Log Message:
-----------
- Set the focus to the search string field on the search form on page load
- Set the focus to the brief description field on the edit_entry form on page 
load (but only for new bookings)

Modified Paths:
--------------
    mrbs/trunk/web/Themes/default/header.inc
    mrbs/trunk/web/search.php

Modified: mrbs/trunk/web/Themes/default/header.inc
===================================================================
--- mrbs/trunk/web/Themes/default/header.inc    2009-12-13 18:32:27 UTC (rev 
1284)
+++ mrbs/trunk/web/Themes/default/header.inc    2009-12-13 19:34:50 UTC (rev 
1285)
@@ -227,6 +227,22 @@
   }
   
   <?php
+  // EDIT_ENTRY.PHP
+  // put the booking name field in focus (but only for new bookings,
+  // ie when the field is empty:  if it's a new booking you have to
+  // complete that field, but if it's an existing booking you might
+  // want to edit any field)
+  if ($page == 'edit_entry')
+  {
+  ?>
+  var form = document.getElementById('main');
+  if (form && form.name && (form.name.value.length == 0))
+  {
+    form.name.focus();
+  }
+  <?php
+  }
+
   // PENDING.PHP
   if ($page == 'pending')
   {
@@ -234,7 +250,20 @@
     activate_sub_tables();
   <?php
   }
+
+  // SEARCH.PHP
+  // put the search string field in focus
+  if ($page == 'search')
+  {
   ?>
+  var form = document.getElementById('search_form');
+  if (form && form.search_str)
+  {
+    form.search_str.focus();
+  }
+  <?php
+  }
+  ?>
 }
 
 

Modified: mrbs/trunk/web/search.php
===================================================================
--- mrbs/trunk/web/search.php   2009-12-13 18:32:27 UTC (rev 1284)
+++ mrbs/trunk/web/search.php   2009-12-13 19:34:50 UTC (rev 1285)
@@ -42,7 +42,7 @@
 if (!empty($advanced))
 {
   ?>
-  <form class="form_general" method="get" action="search.php">
+  <form class="form_general" id="search_form" method="get" action="search.php">
     <fieldset>
     <legend><?php echo get_vocab("advanced_search") ?></legend>
       <div id="div_search_str">


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

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to