title: Capture value of Select list when form is submitted - Drupal
body: <p>I need to use the selected value of a select list when the form is submitted (in submit handler). I am familiar with using the Form API, but can't find the solution on drupal.org.</p>
  
  <p>For example, I am loading a select list with 3 options. When the user selects a value and submits. I want to grab that value and use it in an SQL query that I have located in my submit handler.</p>
  
  <pre><code>$form['my_select'] = array('#type = 'select',
                             '#title' = 'Pick a value',
                             '#options' = array('dog' =&gt; 'Choice One', 
                                                'cat' =&gt; 'Choice two',
                                                'bird'=&gt; 'Choice three'),
                            );
  </code></pre>
  
  <p>Then I want to use the value the user selected in a custom submit handler.</p>