title: Drupal 7 Form API - custom autocomplete filter
body: <p>Using the D7 form API, I need to create a hierarchical set of filters, each having a dependency of the previous filter(s). When a selection is made on one of the filters, all filters down the line are automatically updated based on the selection(s) up the chain. Seems straight forward enough, but there is a little bit more than that.</p>
  
  <p>For a example, lets say I have a database with +75k product records I want to display.</p>
  
  <ul>
  <li>Filter 1 - Brand (10k possible options)</li>
  <li>Filter 2 - Product (20k possible options)</li>
  <li>Filter 3 - Name (75k possible options)</li>
  </ul>
  
  <p>Obviously I can't show all options in each select-multi, so here is how I envisioned it working:</p>
  
  <ol>
  <li>Page loads, all filters are empty</li>
  <li>Each filter has a little text input above it. Typing that that field auto-completes, but the results are dumped into the select-multi input.</li>
  <li>User selects an option(s) from the list that has just been populated.</li>
  <li>All filters down the line automatically populate, refined by the selection(s) up the chain.</li>
  </ol>
  
  <p>I've been looking at the D7 form api, and I can't find any mention of this sort of functionality. I know there are #ajax and #state callbacks, but the text input auto-complete populating the select-multi and triggering events down the chain is a little fuzzy.</p>
  
  <p>If it helps, I've built this entire functionality already using jQuery. My goal now is to port it over into Drupal, using the proper form API.</p>