title: Search Through HABTM Checkbox/List
body: <p>I have this contact form which also relates to a few other tables with a HABTM relationship. They are displayed in the form either as a list or as checkboxes. What I want is to be able to search through them while still in the form to select those that are applicable to the contact I am adding with the form. I'm not sure how to do this- was thinking maybe Javascript? </p>
  
  <p>An example of what I am talking about is like Facebook when you're searching through your friends list. </p>
  
  <p>Below are the HABTM relationships for the Contact Model:</p>
  
  <pre><code>    public $hasAndBelongsToMany = array(
      'Company' =&gt; array(
          'className' =&gt; 'Company',
          'joinTable' =&gt; 'companies_contacts',
          'foreignKey' =&gt; 'contact_id',
          'associationForeignKey' =&gt; 'company_id',
          'unique' =&gt; 'keepExisting',
          'dependent' =&gt; true,
          'conditions' =&gt; '',
          'fields' =&gt; '',
          'order' =&gt; '',
          'limit' =&gt; '',
          'offset' =&gt; '',
          'finderQuery' =&gt; '',
          'deleteQuery' =&gt; '',
          'insertQuery' =&gt; ''
      ),
      'Event' =&gt; array(
          'className' =&gt; 'Event',
          'joinTable' =&gt; 'contacts_events',
          'foreignKey' =&gt; 'contact_id',
          'associationForeignKey' =&gt; 'event_id',
          'unique' =&gt; 'keepExisting',
          'dependent' =&gt; true,
          'conditions' =&gt; '',
          'fields' =&gt; '',
          'order' =&gt; '',
          'limit' =&gt; '',
          'offset' =&gt; '',
          'finderQuery' =&gt; '',
          'deleteQuery' =&gt; '',
          'insertQuery' =&gt; ''
      ),
      'Screenoccupation' =&gt; array(
          'className' =&gt; 'Screenoccupation',
          'joinTable' =&gt; 'contacts_screenoccupations',
          'foreignKey' =&gt; 'contact_id',
          'associationForeignKey' =&gt; 'screenoccupation_id',
          'unique' =&gt; 'keepExisting',
          'dependent' =&gt; true,
          'conditions' =&gt; '',
          'fields' =&gt; '',
          'order' =&gt; '',
          'limit' =&gt; '',
          'offset' =&gt; '',
          'finderQuery' =&gt; '',
          'deleteQuery' =&gt; '',
          'insertQuery' =&gt; ''
      ),
      'Tapearchive' =&gt; array(
          'className' =&gt; 'Tapearchive',
          'joinTable' =&gt; 'contacts_tapearchives',
          'foreignKey' =&gt; 'contact_id',
          'associationForeignKey' =&gt; 'tapearchive_id',
          'unique' =&gt; 'keepExisting',
          'dependent' =&gt; true,
          'conditions' =&gt; '',
          'fields' =&gt; '',
          'order' =&gt; '',
          'limit' =&gt; '',
          'offset' =&gt; '',
          'finderQuery' =&gt; '',
          'deleteQuery' =&gt; '',
          'insertQuery' =&gt; ''
      ),
      'Relation' =&gt; array(
          'className' =&gt; 'Contact',
          'joinTable' =&gt; 'contacts_contacts',
          'foreignKey' =&gt; 'contact_id',
          'associationForeignKey' =&gt; 'related_id',
          'unique' =&gt; true,
          'conditions' =&gt; '',
          'fields' =&gt; '',
          'order' =&gt; '',
          'limit' =&gt; '',
          'offset' =&gt; '',
          'finderQuery' =&gt; '',
          'deleteQuery' =&gt; '',
          'insertQuery' =&gt; ''
      )
  );
  </code></pre>
  
  <p>Not sure what other codes I need to show you guys, so please do let me know what codes are needed and I will add them to this question. </p>
  
  <p>Thanks!</p>