$rel = "rel='$search_box'"; // set relation to list
if ($opts['search_submit']) {
-
if (isset($_POST[$search_submit])) {
- $Ajax->activate($name);
+ if (!$opts['async'])
+ $Ajax->activate('_page_body');
+ else
+ $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 != '*') {
$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;
}
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
) );
}
echo "<td>$label</td>\n";
echo "<td>";
if ($enabled)
- $sel = "<select name='$name' onchange='this.form.submit();'>\n";
+ $sel = "<select name='$name' onchange='JsHttpRequest.request(\"_{$name}_update\", this.form);'>\n";
+
else
$sel = "<select disabled name='$name'>\n";
if ($selected_id == null)
label_cell($label);
echo "<td><select name='$name'";
if ($submit_on_change)
- echo " onchange='this.form.submit();'>"; // FIX ajax
+ echo " onchange='JsHttpRequest.request(\"_{$name}_update\", this.form);'>";
else
echo ">";
echo "<option " . ($selected == 'Return'?" selected ":"") . " value='Return'>" . _("Items Returned to Inventory Location"). "</option>\n";