X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=f136c38229cccdced7113d1c99ee5d869689a716;hb=8c893a568ed275b1695b2f4df8cfda131a997a64;hp=0db2e10790523d27c117907a40ae7e6bbdb3cf4f;hpb=42c18d55006587f51057a4ff093233e557ee384e;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 0db2e107..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($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 = "