Only show Active Items in autocomplete

Only show Active Items in autocomplete

I have a question. I have an Autocomplete the is shwing a list of Active people. Is there a way to only show Active people but if they type a name of an Inactive person the name will show in the input box but not in the dropdown list?

This is my combo box function
  1. (function($) {
  2.     $.widget("ui.combobox", {
  3.         _create: function() {
  4.             var input, self = this,
  5.                 select = this.element.hide(),
  6.                 selected = select.children(":selected"),
  7.                 value = selected.val() ? selected.text() : "",
  8.                 wrapper = this.wrapper = $("<span>").addClass("ui-combobox").insertAfter(select);

  9.             input = $("<input>").appendTo(wrapper).val(value).addClass("ui-state-default ui-combobox-input").autocomplete({
  10.                 delay: 0,
  11.                 minLength: 0,
  12.                 source: function(request, response) {
  13.                     var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");

  14.                     response(select.find("option").map(function() {
  15.                         var text = $(this).text();
  16.                         if (this.value && (!request.term || matcher.test(text))) return {
  17.                             label: text.replace(
  18.                             new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
  19.                             value: text,
  20.                             option: this,
  21.                             category: $(this).closest("optgroup").attr("label")
  22.                         };
  23.                         //MK
  24.                         $('#test').attr('style', 'display: none;');
  25.                     }).get());
  26.                 },
  27.                 select: function(event, ui) {
  28.                     ui.item.option.selected = true;
  29. getVendor();
  30.                     self._trigger("selected", event, {
  31.                         item: ui.item.option
  32.                     });
  33.                 },
  34.                 change: function(event, ui) {
  35.                     if (!ui.item) {
  36.                         var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex($(this).val()) + "$", "i"),
  37.                             valid = false;
  38.                         select.children("option").each(function() {
  39.                             if ($(this).text().match(matcher)) {
  40.                                 this.selected = valid = true;
  41.                                 return false;
  42.                             }
  43.                         });
  44.                         if (!valid) {
  45. getVendor();
  46.                             $('#test').attr('style', 'display: block;');
  47.                             // remove invalid value, as it didn't match anything
  48.                             //$( this ).val( "" );
  49.                             //select.val( "" );
  50.                             //input.data( "autocomplete" ).term = "";
  51.                             //return false;                    
  52.                         }
  53.                     }
  54.                 }
  55.             }).addClass("ui-widget ui-widget-content ui-corner-left");

  56.             input.data("autocomplete")._renderItem = function(ul, item) {
  57.                 return $("<li></li>").data("item.autocomplete", item).append("<a>" + item.label + "</a>").appendTo(ul);
  58.             };

  59.             input.data("autocomplete")._renderMenu = function(ul, items) {
  60.                 var self = this,
  61.                     currentCategory = "";
  62.                 $.each(items, function(index, item) {
  63.                     if (item.category != currentCategory) {
  64.                         if (item.category) {
  65.                             ul.append("<li class='ui-autocomplete-category'><b>" + item.category + "</b></li>");
  66.                         }
  67.                         currentCategory = item.category;
  68.                     }
  69.                     self._renderItem(ul, item);
  70.                 });
  71.             };

  72.             $("<a>").attr("tabIndex", -1).attr("title", "Show All Items").appendTo(wrapper).button({
  73.                 icons: {
  74.                     primary: "ui-icon-triangle-1-s"
  75.                 },
  76.                 text: false
  77.             }).removeClass("ui-corner-all").addClass("ui-corner-right ui-combobox-toggle").click(function() {
  78.                 // close if already visible
  79.                 if (input.autocomplete("widget").is(":visible")) {
  80.                     input.autocomplete("close");
  81.                     return;
  82.                 }

  83.                 // work around a bug (likely same cause as #5265)
  84.                 $(this).blur();

  85.                 // pass empty string as value to search for, displaying all results
  86.                 input.autocomplete("search", "");
  87.                 input.focus();
  88.             });
  89.         },

  90.         destroy: function() {
  91.             this.wrapper.remove();
  92.             this.element.show();
  93.             $.Widget.prototype.destroy.call(this);
  94.         }
  95.     });
  96. })(jQuery);

  97. $(function() {
  98.     $("#combobox").combobox();
  99.     $("#toggle").click(function() {
  100.         $("#combobox").toggle();
  101.     });
  102. });

this is my html
  1. <select id="combobox" name="chkPayTo" >
  2.                                                            <option value="" selected="selected"></option>
  3.                                                                 <cfloop query="getCustomer">
  4.                                                                         <cfif #getCustomer.Type# neq #customerType#>
  5.                                                                             <cfset customerType = #getCustomer.Type#>
  6.                                                                             <optgroup label="<cfoutput>#getCustomer.TypeName#</cfoutput>">
  7.                                                                         </cfif>
  8.                                                                         <option value="<cfoutput>#getCustomer.TypeCode#_#getCustomer.ID#</cfoutput>"><cfoutput>#getCustomer.Name#</cfoutput></option>
  9.                                                                     </cfloop>
  10.                                                             </select>

My boss asked me today if the active people will show up on the dropdown but be able to type an inactive person and have then show up. 

I do have a way set up that if not valid i call a JS function up to check the non valid people. This worded but for this page I am getting 3 different types of people from 3 different sources.

I tried checking to see if the person was inactive make the option not visible but in the autocomplete it showes them.