Automatic first field focus on page start, preserved focus sequence
[fa-stable.git] / sales / sales_order_entry.php
index 0524212b0e352aac7c874a254bf33905fc6ff8f4..7e271a5686ee3c78ccac4ce4e910ebd4893f03a2 100644 (file)
@@ -284,6 +284,7 @@ function handle_update_item()
                 input_num('Disc') / 100 );
        }
   copy_from_cart();
+  set_focus('StockID2');
 }
 
 //--------------------------------------------------------------------------------
@@ -295,6 +296,7 @@ function handle_delete_item($line_no)
     } else {
        display_error(_("This item cannot be deleted because some of it has already been delivered."));
     }
+    set_focus('StockID2');
 }
 
 //--------------------------------------------------------------------------------
@@ -308,6 +310,7 @@ function handle_new_item()
                input_num('price'), input_num('Disc') / 100);
 
        $_POST['StockID2'] = $_POST['stock_id'] = "";
+       set_focus('StockID2');
 }
 
 //--------------------------------------------------------------------------------
@@ -393,6 +396,9 @@ if (isset($_POST['UpdateItem']))
 if (isset($_POST['AddItem']))
        handle_new_item();
 
+if (isset($_POST['CancelItemChanges']) || isset($_POST['UpdateItem']))
+       set_focus('StockID2');
+
 //--------------------------------------------------------------------------------
 
 check_db_has_stock_items(_("There are no inventory items defined in the system."));