title: How to save the id of a Zend_Dojo_Form_Element_ComboBox not the text
body: <p>Can anyone tell me how I can save the ID of a Dojo ComboBox element in Zend. Sorry if this is simple but I can't figure out the answer.</p>
  
  <p>My combobox code is as follows</p>
  
  <pre><code>  // Create a autocomplete input for counties
    $county = new Zend_Dojo_Form_Element_ComboBox('county');
      $county-&gt;setLabel('County');
        $county-&gt;setOptions(array(
        'autocomplete' =&gt; true,
        'storeId'   =&gt; 'countyStore',
        'storeType' =&gt; 'dojo.data.ItemFileReadStore',
        'storeParams' =&gt; array('url' =&gt; "/clients/client/autocomplete"),
        'dijitParams' =&gt; array('searchAttr' =&gt; 'county')))
          -&gt;setRequired(true)
          -&gt;addValidator('NotEmpty', true)
          -&gt;addFilter('HTMLEntities')            
          -&gt;addFilter('StringToLower')        
          -&gt;addFilter('StringTrim');
  </code></pre>
  
  <p>The code for my autocompleteAction is as follows</p>
  
  <pre><code>public function autocompleteAction()
   {
  // disable layout and view rendering
  $this-&gt;_helper-&gt;layout-&gt;disableLayout();
  $this-&gt;getHelper('viewRenderer')-&gt;setNoRender(true);
  
  // get list of breed names from the breeds table
   $qry= Doctrine_Query::create()
      -&gt;from('PetManager_Model_Counties c');
  
      $result=$qry-&gt;fetchArray();
  
     //generate and return JSON string countiesID being the primary key of the table
     $data = new Zend_Dojo_Data('countiesID',$result,'countiesID');
     echo $data-&gt;toJson();
   }
  </code></pre>
  
  <p>The form is an input form for saving new clients. The table that it manipulates has a field county that references a table counties and hence only accepts Int values.</p>
  
  <p>I want to save the primary key of the county 'countiesID' from that selected in the Dojo ComboBox, currently only the text selected is passed i.e. 'Dublin' not '10', which of course throws an exception when I try to save the record.</p>
  
  <p>I know how to do this with a standard combobox in that I would create a function that would query the counties table and use a foreach array to add the primary key and county name to the form via addMultiOption but I can figure out how to do this when using the Dojo autocomplete combobox.</p>