X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=f136c38229cccdced7113d1c99ee5d869689a716;hb=8c893a568ed275b1695b2f4df8cfda131a997a64;hp=6e7e64f02d4e4acc65db52b982b3edb39cd5ec71;hpb=f98da37159fd22d42996553668c1a3533c2c84ba;p=fa-stable.git
diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc
index 6e7e64f0..f136c382 100644
--- a/includes/ui/ui_lists.inc
+++ b/includes/ui/ui_lists.inc
@@ -233,7 +233,7 @@ $opts = array( // default options
$search_submit)."\n";
}
}
- default_focus($search_box ? $search_box : $name);
+ default_focus(($search_box && $by_id) ? $search_box : $name);
$str = $selector;
if ($search_box && $opts['cells'])
echo ($edit_entry!='' ? "
$edit_entry | " : '')."$selector | ";
@@ -297,7 +297,7 @@ $opts = array( // default options
//if($name=='SelectStockFromList') display_error($sql);
foreach($items as $value=>$descr) {
$sel = '';
- if ($selected_id == $value) {
+ if ((string)$selected_id === (string)$value) {
$sel = 'selected';
$found = $value;
}
@@ -318,8 +318,9 @@ $opts = array( // default options
}
if ($found === false) {
- $_POST[$name] = $first_id;
+ $selected_id = $first_id;
}
+ $_POST[$name] = $selected_id;
$aspect = $opts['edit_submit'] ? " aspect='editable'" : '';
$selector = "