Index: branches/5.2.x/core/admin_templates/js/ajax.js =================================================================== diff -u -N -r14572 -r14620 --- branches/5.2.x/core/admin_templates/js/ajax.js (.../ajax.js) (revision 14572) +++ branches/5.2.x/core/admin_templates/js/ajax.js (.../ajax.js) (revision 14620) @@ -357,13 +357,14 @@ } // AJAX DropdownPreloader class -function AjaxDropdownPreloader($url, $input_mask, $filter_field, $dependend_field, value) { +function AjaxDropdownPreloader($url, $input_mask, $filter_field, $dependend_field, value, $has_empty) { this.URL = $url; this.InputMask = $input_mask; this.FilterField = $filter_field; this.DependendField = $dependend_field; this.Titles = this.prepareTitles(); this.Value = value; + this.HasEmpty = $has_empty === undefined ? true : $has_empty; this.BusyRequest = false; } @@ -432,12 +433,13 @@ } break; case 'field_options': - if (!$dst_field.multiple) { + if (this.HasEmpty && !$dst_field.multiple) { this.addOption($dst_field, '', ''); } + // add new states this.ProcessXMLNode($child, $dst_field, $selected_value); - if ($dst_field.options.length == 0 || $dst_field.options.length == 2) { + if ($dst_field.options.length == 0 || $dst_field.options.length == (this.HasEmpty ? 2 : 1)) { $dst_field.value = $dst_field.options[$dst_field.options.length - 1].value; } break;