title: How to filter ModelAdmin autocomplete_fields results from clientside input
body: <p>This is a followup on this thread: <a href="https://stackoverflow.com/a/55476825/2817212"> How to filter ModelAdmin autocomplete_fields results with the context of limit_choices_to</a></p>
  
  <p>Uberdude proposed a solution which works great to customize the autoselect queryset based on the field which triggered the request, but I would also need to filter based on input from the client side, most specifically a checkbox which is not a model field, and only for some of the fields in the form as in this form excerpt.</p>
  
  <p><a href="https://i.stack.imgur.com/hHB6O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hHB6O.png" alt="Form"></a></p>
  
  <p>I managed to apply the checkbox to the widget by overriding your AutocompleteSelect widget as:</p>
  
  <pre><code>class AutocompleteSelectCb(AutocompleteSelect):
  def render(self, name, value, attrs=None):
      s = super().render(name, value, attrs)
      return mark_safe('&lt;div style="margin-bottom:10px;"&gt;&lt;input type="checkbox" id="parent1"\
           name="parentx" value="1"&gt;Search among all kennels&lt;/div&gt;' + s)
  </code></pre>
  
  <p>and use that widget only when the fields are present in a autocomplete_cb_fields attribute in the admin:</p>
  
  <pre><code> autocomplete_fields = ['breed']
   autocomplete_cb_fields = ['father', 'mother']
  </code></pre>
  
  <p>However, I am not sure how to get my AutocompleteSelectCb widget to send the status of the checkbox so that it can be processed in the get_search_results method. I assume with some js, but how? Any idea?</p>