Finished ajax improvements to sales & purchase modules,
[fa-stable.git] / includes / ui / ui_lists.inc
index 375498d0f2bc9a367d3bda4921dcbb64ee2f6050..1176cc5f8d538dff76d8e7a721a21c729c6080af 100644 (file)
@@ -101,10 +101,10 @@ $opts = array(            // default options
                        $Ajax->activate($name);
        }
        if ($txt == '') {
-               if ($spec_option === false)
-               $limit = ' LIMIT 1';
+               if ($spec_option === false && $selected_id==null)
+                 $limit = ' LIMIT 1';
                else
-               $opts['where'][] = $valfield . "='". get_post($name, $spec_id)."'";
+                 $opts['where'][] = $valfield . "='". get_post($name, $spec_id)."'";
        }
        else
                if ($txt != '*') {
@@ -136,7 +136,7 @@ $opts = array(              // default options
                        $descr = $opts['format']==null ?  $contact_row[1] :
                        call_user_func($opts['format'], $contact_row);
                        $sel = '';
-                       if ($selected_id === $value) {
+                       if ((string)($selected_id) === $value) {
                                $sel = 'selected';
                                $found = $value;
                        }
@@ -356,8 +356,7 @@ return combo_input($name, $selected_id, $sql, 'loc_code', 'location_name',
        array(
                'spec_option' => $all_option === true ? _("All Locations") : $all_option,
                'spec_id' => $all_items,
-               'select_submit'=> $submit_on_change,
-               'async' => false
+               'select_submit'=> $submit_on_change
        ) );
 }